Fix error response format

This commit is contained in:
syuilo 2019-02-22 14:22:40 +09:00
parent cc8a7dd588
commit a44ac3306e
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ export default async (endpoint: IEndpoint, ctx: Koa.BaseContext) => {
ctx.status = 204;
} else if (typeof x === 'number') {
ctx.status = x;
ctx.body = y;
ctx.body = { error: y };
} else {
ctx.body = x;
}