Don't leak error details (including the stack trace) upon API call failure to client in production

This commit is contained in:
yumeko 2023-07-21 22:32:39 +03:00
parent 740ebcf5cc
commit 47f5cb2e76

View file

@ -33,7 +33,7 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) =>
code: y!.code, code: y!.code,
id: y!.id, id: y!.id,
kind: y!.kind, kind: y!.kind,
...(y!.info ? { info: y!.info } : {}), ...((y!.info && process.env.NODE_ENV !== "production") ? { info: y!.info } : {}),
}, },
}; };
} else { } else {