Skip to content

Commit

Permalink
standard error process.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoutk committed Mar 21, 2019
1 parent c7644b2 commit 7702e4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares/globalError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default () => {
try {
await next()
} catch (err) {
ctx.body = G.jsResponse(ctx.ErrCode, err.message, { stack: err.stack })
ctx.body = G.jsResponse(ctx.ErrCode || G.STCODES.EXCEPTION, err.message, { stack: err.stack })
}
}
}

0 comments on commit 7702e4c

Please sign in to comment.