We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee6e53 commit 503b65dCopy full SHA for 503b65d
src/main/adapters/express-route-adapter.ts
@@ -7,6 +7,12 @@ export const adaptRoute = (controller: Controller) => {
7
body: req.body,
8
};
9
const httpResponse = await controller.handle(httpRequest);
10
- res.status(httpResponse.statusCode).json(httpResponse.body);
+ if (httpResponse.statusCode === 200) {
11
+ res.status(httpResponse.statusCode).json(httpResponse.body);
12
+ } else {
13
+ res.status(httpResponse.statusCode).json({
14
+ error: httpResponse.body.message,
15
+ });
16
+ }
17
18
0 commit comments