Skip to content

Commit

Permalink
Add more console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Nov 10, 2020
1 parent 343c186 commit d3b502b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,7 @@ export class IndexPatternsService {
const scriptdFields = Object.values(fields).filter((field) => field.scripted);
try {
const newFields = await this.getFieldsForWildcard(options);
// eslint-disable-next-line no-console
console.log('getFieldsForWildcard returns', JSON.stringify(newFields));
const result = this.fieldArrayToMap([...newFields, ...scriptdFields]);
// eslint-disable-next-line no-console
console.log('fieldArrayToMap returns', JSON.stringify(result));
return result;
return this.fieldArrayToMap([...newFields, ...scriptdFields]);
} catch (err) {
// eslint-disable-next-line no-console
console.log('refreshFieldSpecMap ERROR', JSON.stringify(err));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,23 @@ export class IndexPatternsApiClient implements IIndexPatternsApiClient {
meta_fields: metaFields,
};
}
// eslint-disable-next-line no-console
console.log('API client url', url);
// eslint-disable-next-line no-console
console.log('API client query', JSON.stringify(query));

return this._request(url, query).then((resp: any) => resp.fields);
return this._request(url, query)
.then((resp: any) => {
// eslint-disable-next-line no-console
console.log('API client url response', JSON.stringify(resp));
return resp.fields;
})
.catch((e) => {
// eslint-disable-next-line no-console
console.error('API client Error Message', e.message);
// eslint-disable-next-line no-console
console.error('API client Error', JSON.stringify(e));
throw new Error('API client ERROR');
});
}
}

0 comments on commit d3b502b

Please sign in to comment.