Skip to content

Commit

Permalink
[Query enhancements] use status 503 if opensearch throws 500
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 committed Nov 15, 2024
1 parent e993d24 commit 896ca26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/query_enhancements/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ export function defineSearchStrategyRouteProvider(logger: Logger, router: IRoute
} catch (e) {
error = err;
}
const statusCode = error.status || err.status;
return res.custom({
statusCode: error.status || err.status,
statusCode: statusCode === 500 ? 503 : statusCode || 503,
body: err.message,
});
}
Expand Down

0 comments on commit 896ca26

Please sign in to comment.