From 7702e4c6aae073535af2a88f0d67b02467f1b8fb Mon Sep 17 00:00:00 2001 From: zhoutk Date: Thu, 21 Mar 2019 13:44:54 +0800 Subject: [PATCH] standard error process. --- src/middlewares/globalError.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewares/globalError.ts b/src/middlewares/globalError.ts index 6062799..d342124 100644 --- a/src/middlewares/globalError.ts +++ b/src/middlewares/globalError.ts @@ -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 }) } } } \ No newline at end of file