Initial commit
This commit is contained in:
21
app/exceptions/handler.js
Normal file
21
app/exceptions/handler.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import app from '@adonisjs/core/services/app';
|
||||
import { ExceptionHandler } from '@adonisjs/core/http';
|
||||
export default class HttpExceptionHandler extends ExceptionHandler {
|
||||
debug = !app.inProduction;
|
||||
renderStatusPages = app.inProduction;
|
||||
statusPages = {
|
||||
'404': (error, { view }) => {
|
||||
return view.render('pages/errors/not_found', { error });
|
||||
},
|
||||
'500..599': (error, { view }) => {
|
||||
return view.render('pages/errors/server_error', { error });
|
||||
},
|
||||
};
|
||||
async handle(error, ctx) {
|
||||
return super.handle(error, ctx);
|
||||
}
|
||||
async report(error, ctx) {
|
||||
return super.report(error, ctx);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=handler.js.map
|
||||
1
app/exceptions/handler.js.map
Normal file
1
app/exceptions/handler.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../app/exceptions/handler.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,6BAA6B,CAAA;AAC7C,OAAO,EAAe,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGnE,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,gBAAgB;IAKtD,KAAK,GAAG,CAAC,GAAG,CAAC,YAAY,CAAA;IAOzB,iBAAiB,GAAG,GAAG,CAAC,YAAY,CAAA;IAMpC,WAAW,GAAgD;QACnE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACzB,OAAO,IAAI,CAAC,MAAM,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAC5D,CAAC;KACF,CAAA;IAMD,KAAK,CAAC,MAAM,CAAC,KAAc,EAAE,GAAgB;QAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACjC,CAAC;IAQD,KAAK,CAAC,MAAM,CAAC,KAAc,EAAE,GAAgB;QAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACjC,CAAC;CACF"}
|
||||
Reference in New Issue
Block a user