Fix error response format
This commit is contained in:
parent
cc8a7dd588
commit
a44ac3306e
|
@ -15,7 +15,7 @@ export default async (endpoint: IEndpoint, ctx: Koa.BaseContext) => {
|
||||||
ctx.status = 204;
|
ctx.status = 204;
|
||||||
} else if (typeof x === 'number') {
|
} else if (typeof x === 'number') {
|
||||||
ctx.status = x;
|
ctx.status = x;
|
||||||
ctx.body = y;
|
ctx.body = { error: y };
|
||||||
} else {
|
} else {
|
||||||
ctx.body = x;
|
ctx.body = x;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue