summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/api/api-handler.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts
index 0fe4994893..827aecdf25 100644
--- a/src/server/api/api-handler.ts
+++ b/src/server/api/api-handler.ts
@@ -13,7 +13,15 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res)
ctx.status = 204;
} else if (typeof x === 'number') {
ctx.status = x;
- ctx.body = { error: y };
+ ctx.body = {
+ error: {
+ message: y.message,
+ code: y.code,
+ id: y.id,
+ kind: y.kind,
+ ...(y.info ? { info: y.info } : {})
+ }
+ };
} else {
ctx.body = x;
}