File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 5555< body >
5656 < h1 > Page Not Found</ h1 >
5757 < p > Sorry, but the page you were trying to view does not exist.</ p >
58+ < button onclick ="javascript:window.location = '/'; "> Go to homepage</ button >
5859</ body >
5960</ html >
6061<!-- IE needs 512+ bytes: https://docs.microsoft.com/en-us/archive/blogs/ieinternals/friendly-http-error-pages -->
Original file line number Diff line number Diff line change 5555< body >
5656 < h1 > Internal Server Error</ h1 >
5757 < p > An internal server error occurred.</ p >
58+ < button onclick ="javascript:document.location.reload(true); "> Try again</ button >
5859</ body >
5960</ html >
6061<!-- IE needs 512+ bytes: https://docs.microsoft.com/en-us/archive/blogs/ieinternals/friendly-http-error-pages -->
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ const opts = {
5353 encoding : 'utf8'
5454} ;
5555
56+ //
57+ // TODO: we could eventually use this https://github.com/alexphelps/server-error-pages/
58+ //
5659// error pages were inspired by HTML5 Boilerplate's default 404.html page
5760// https://github.com/h5bp/html5-boilerplate/blob/master/src/404.html
5861const _404 = fs . readFileSync ( path . join ( __dirname , '404.html' ) , opts ) ;
@@ -192,15 +195,15 @@ function errorHandler(
192195 } else {
193196 this . body = _404 ;
194197 }
195- } else if ( noReferrer || this . status === 500 ) {
198+ } else if ( noReferrer ) {
196199 // this prevents a redirect loop by detecting an empty Referrer
197200 // ...otherwise it would reach the next conditional block which
198201 // would endlessly rediret the user with `this.redirect('back')`
199202
200203 // flash an error message
201204 if ( hasFlash ) this . flash ( 'error' , err . message ) ;
202205
203- // render the 500 page
206+ // render the 5xx page
204207 if ( hasRender ) {
205208 try {
206209 await this . render ( '500' ) ;
You can’t perform that action at this time.
0 commit comments