Merge branch 'fix/dont-leak-api-error-stack' into 'develop'

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

See merge request firefish/firefish!10522
This commit is contained in:
Kainoa Kanter 2023-07-21 23:14:13 +00:00
commit c0bbf03201

View File

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