Enhance server side error handling (#4537)

* fix: server side error handling

* fix: push only unknown 500 errors to sentry

* fix: use in-house onerror in favor of errorHandling middleware

* fix: split error template into dev and prod envs

* fix: check Error instance

* fix: error routes in test env

* fix: review comments

* Remove koa-onerror

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Apoorv Mishra
2022-12-09 21:51:42 +05:30
committed by GitHub
parent 4f67437b81
commit 053d10d893
17 changed files with 319 additions and 78 deletions

View File

@@ -5,6 +5,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
@@ -13,6 +14,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
@@ -21,6 +23,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
@@ -119,6 +122,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
@@ -127,6 +131,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;

View File

@@ -14,6 +14,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
@@ -67,6 +68,7 @@ Object {
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
@@ -84,5 +86,6 @@ Object {
"error": "",
"message": "The name of this group is already in use (isUniqueNameInTeam)",
"ok": false,
"status": 400,
}
`;