Skip to content

Commit

Permalink
feat: return err direct
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangsx committed May 7, 2023
1 parent 798099d commit 88c0eef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const errorHandler = async (ctx: Context, next: Next) => {
await next();
} catch (err:any) {
ctx.response.status = err.status || 500;
ctx.response.body = {
message: err.message,
};
ctx.response.body = err;
}
};
app.use(errorHandler);
Expand Down

0 comments on commit 88c0eef

Please sign in to comment.