strictNullChecks (#4666)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
This commit is contained in:
@ -15,11 +15,11 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res)
|
||||
ctx.status = x;
|
||||
ctx.body = {
|
||||
error: {
|
||||
message: y.message,
|
||||
code: y.code,
|
||||
id: y.id,
|
||||
kind: y.kind,
|
||||
...(y.info ? { info: y.info } : {})
|
||||
message: y!.message,
|
||||
code: y!.code,
|
||||
id: y!.id,
|
||||
kind: y!.kind,
|
||||
...(y!.info ? { info: y!.info } : {})
|
||||
}
|
||||
};
|
||||
} else {
|
||||
@ -31,9 +31,9 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res)
|
||||
// Authentication
|
||||
authenticate(body['i']).then(([user, app]) => {
|
||||
// API invoking
|
||||
call(endpoint.name, user, app, body, (ctx.req as any).file).then(res => {
|
||||
call(endpoint.name, user, app, body, (ctx.req as any).file).then((res: any) => {
|
||||
reply(res);
|
||||
}).catch(e => {
|
||||
}).catch((e: ApiError) => {
|
||||
reply(e.httpStatusCode ? e.httpStatusCode : e.kind == 'client' ? 400 : 500, e);
|
||||
});
|
||||
}).catch(() => {
|
||||
|
Reference in New Issue
Block a user