Pass the original ES error message back with the correct status code
This commit is contained in:
parent
f3ee0ce361
commit
0f92cc7590
1 changed files with 5 additions and 5 deletions
|
@ -16,13 +16,13 @@ export default function (server) {
|
|||
error instanceof esErrors.ServiceUnavailable ||
|
||||
error instanceof esErrors.NoConnections ||
|
||||
error instanceof esErrors.RequestTimeout) {
|
||||
return Boom.serverTimeout();
|
||||
} else if (error instanceof esErrors.Conflict) {
|
||||
return Boom.conflict();
|
||||
return Boom.serverTimeout(error);
|
||||
} else if (error instanceof esErrors.Conflict || _.contains(error.message, 'index_template_already_exists')) {
|
||||
return Boom.conflict(error);
|
||||
} else if (error instanceof esErrors[403]) {
|
||||
return Boom.forbidden();
|
||||
return Boom.forbidden(error);
|
||||
} else if (error instanceof esErrors.NotFound) {
|
||||
return Boom.notFound();
|
||||
return Boom.notFound(error);
|
||||
} else if (error instanceof esErrors.BadRequest || error instanceof TypeError) {
|
||||
return Boom.badRequest(error);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue