mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Log courier errors to inspector (#29408)
* Log error if courier request fails * Temporary i18n fix
This commit is contained in:
parent
e56342e8ad
commit
0940144f60
1 changed files with 17 additions and 10 deletions
|
@ -101,19 +101,26 @@ const CourierRequestHandlerProvider = function () {
|
|||
);
|
||||
request.stats(getRequestInspectorStats(requestSearchSource));
|
||||
|
||||
const response = await requestSearchSource.fetch();
|
||||
try {
|
||||
const response = await requestSearchSource.fetch();
|
||||
|
||||
searchSource.lastQuery = queryHash;
|
||||
searchSource.lastQuery = queryHash;
|
||||
|
||||
request
|
||||
.stats(getResponseInspectorStats(searchSource, response))
|
||||
.ok({ json: response });
|
||||
request
|
||||
.stats(getResponseInspectorStats(searchSource, response))
|
||||
.ok({ json: response });
|
||||
|
||||
searchSource.rawResponse = response;
|
||||
|
||||
requestSearchSource.getSearchRequestBody().then(req => {
|
||||
request.json(req);
|
||||
});
|
||||
searchSource.rawResponse = response;
|
||||
} catch(e) {
|
||||
// Log any error during request to the inspector
|
||||
request.error({ json: e });
|
||||
throw e;
|
||||
} finally {
|
||||
// Add the request body no matter if things went fine or not
|
||||
requestSearchSource.getSearchRequestBody().then(req => {
|
||||
request.json(req);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let resp = cloneDeep(searchSource.rawResponse);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue