mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
[Enterprise Search] updated simulate endpoints to return error from simulate (#147898)
## Summary Updated the two simulate endpoints to return an error with the underlying simulate error instead of throwing the error up to the default handler. <img width="1839" alt="image" src="https://user-images.githubusercontent.com/1972968/208780111-c9315897-adc8-40af-bbcf-7a67a997381e.png">
This commit is contained in:
parent
0d2e8156bf
commit
e9c5c16bfd
1 changed files with 12 additions and 4 deletions
|
@ -596,8 +596,12 @@ export function registerIndexRoutes({
|
|||
headers: { 'content-type': 'application/json' },
|
||||
});
|
||||
} catch (e) {
|
||||
log.error(`Error simulating inference pipeline: ${JSON.stringify(e)}`);
|
||||
throw e;
|
||||
return createError({
|
||||
errorCode: ErrorCode.UNCAUGHT_EXCEPTION,
|
||||
message: e.message,
|
||||
response,
|
||||
statusCode: 400,
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -673,8 +677,12 @@ export function registerIndexRoutes({
|
|||
headers: { 'content-type': 'application/json' },
|
||||
});
|
||||
} catch (e) {
|
||||
log.error(`Error simulating inference pipeline: ${JSON.stringify(e)}`);
|
||||
throw e;
|
||||
return createError({
|
||||
errorCode: ErrorCode.UNCAUGHT_EXCEPTION,
|
||||
message: e.message,
|
||||
response,
|
||||
statusCode: 400,
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue