More granular error responses

This commit is contained in:
Tom Moor
2018-02-19 23:31:18 -08:00
parent d73196594d
commit 5b6c908215
11 changed files with 67 additions and 68 deletions

View File

@@ -39,13 +39,7 @@ api.use(async (ctx, next) => {
}
if (message.match('Authorization error')) {
if (ctx.path.match('info')) {
ctx.status = 404;
message = 'Not Found';
} else {
ctx.status = 403;
message = 'Authorization Required';
}
ctx.status = 403;
}
if (ctx.status === 500) {