Fix error response format

This commit is contained in:
syuilo 2019-02-22 14:22:40 +09:00
parent 8e59da66d5
commit fc6b5d2503

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;
}