From 52774bbe6402aee076b2e0648bd1f4764924da8a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 23 Feb 2019 11:20:58 +0900 Subject: Introduce OpenAPI specs (#4351) * wip * wip * wip * Update index.ts * Update gen-openapi-spec.ts * Update api.ja-JP.md * Fix * Improve doc * Update gen-openapi-spec.ts * Update redoc.html * Improve doc * Update gen-openapi-spec.ts * Improve doc * Update CHANGELOG.md --- src/server/api/api-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/api/api-handler.ts') diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts index fdfaea1ff2..00af69703e 100644 --- a/src/server/api/api-handler.ts +++ b/src/server/api/api-handler.ts @@ -26,7 +26,7 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) call(endpoint.name, user, app, body, (ctx.req as any).file).then(res => { reply(res); }).catch(e => { - reply(e.kind == 'client' ? 400 : 500, e); + reply(e.httpStatusCode ? e.httpStatusCode : e.kind == 'client' ? 400 : 500, e); }); }).catch(() => { reply(403, new ApiError({ -- cgit v1.2.3-freya