Skip to content

Commit

Permalink
[controller] Fix bug in error handling (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmendoza-cb authored Jul 27, 2023
1 parent 095d9c0 commit c6af18e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/src/controllers/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ export default class Controller {

static sendError(response, error) {
response.status(500);
if (error.error instanceof Object) {
response.json(error.error);

if (error instanceof Object) {
response.json(error);
} else {
response.end(error.error || error.message);
response.end(error);
}
}

Expand Down

0 comments on commit c6af18e

Please sign in to comment.