You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guess you can put a middle there to catch the error and format the response before Koa. You can pass an object to ctx.throw() as any one of the arguments except first.
Describe the feature
Some time we want our server always reponse with json type, even if it throw custom error, for such code:
But koa reponse all errors with
text
type, we can not change it.Checklist
The text was updated successfully, but these errors were encountered: