Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/ConnectedFilter/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ class ConnectedFilter extends React.Component {
this.state.filter,
)
.then((res) => {
if (!res.data) {
const msg = `error querying guppy${res.errors && res.errors.length > 0 ? `: ${res.errors[0].message}` : ''}`;
console.error(msg); // eslint-disable-line no-console
}
this.handleReceiveNewAggsData(
res.data._aggregation[this.props.guppyConfig.type],
this.state.adminAppliedPreFilters,
Expand Down
5 changes: 4 additions & 1 deletion src/components/Utils/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export const updateCountsInInitialTabsOptions = (
return;
}
const { histogram } = initialTabsOptions[field];
if (!histogram) {
console.error(`Guppy did not return histogram data for filter field ${field}`); // eslint-disable-line no-console
}
histogram.forEach((opt) => {
const { key } = opt;
if (typeof (key) !== 'string') { // key is a range, just copy the histogram
Expand Down Expand Up @@ -87,7 +90,7 @@ export const updateCountsInInitialTabsOptions = (
/* eslint-disable no-console */
// hopefully we won't get here but in case of
// out-of-index error or obj undefined error
console.err('error when processing filter data', err);
console.error('error when processing filter data: ', err);
console.trace();
/* eslint-enable no-console */
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/es/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ES {
type: esType,
body: validatedQueryBody,
}).then((resp) => resp.body, (err) => {
log.error('[ES.query] error during querying');
log.error(`[ES.query] error during querying: ${err.message}`);
throw new Error(err.message);
});
}
Expand Down