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

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<title>Error - //inject-status//</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<style>
body {
padding: 50px 80px;
font: 14px "Helvetica Neue", Helvetica, sans-serif;
}
h1 {
font-size: 2em;
margin-bottom: 5px;
}
pre {
font-size: .8em;
}
</style>
</head>
<body>
<div id="error">
<h1>Error</h1>
<p>Looks like something broke!</p>
<pre>
<code>
//inject-stack//
</code>
</pre>
</div>
</body>
</html>

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>Error - //inject-status//</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<style>
body {
padding: 50px 80px;
font: 14px "Helvetica Neue", Helvetica, sans-serif;
}
h1 {
font-size: 2em;
margin-bottom: 5px;
}
pre {
font-size: .8em;
}
</style>
</head>
<body>
<div id="error">
<h1>Error</h1>
<p>Looks like something broke!</p>
</div>
</body>
</html>