Skip to content

Commit

Permalink
ensure error status gets passed correctly to wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Jan 2, 2020
1 parent 8c93d6b commit b8c3bd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/ml/server/client/error_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { boomify, isBoom } from 'boom';
import { ResponseError, CustomHttpResponseOptions } from 'src/core/server';

export function wrapError(error: any): CustomHttpResponseOptions<ResponseError> {
const boom = isBoom(error) ? error : boomify(error);
const boom = isBoom(error) ? error : boomify(error, { statusCode: error.status });
return {
body: boom,
headers: boom.output.headers,
Expand Down

0 comments on commit b8c3bd0

Please sign in to comment.