ui: add constant to error page

This commit is contained in:
undefined committed 2021-11-01 10:32:10 +08:00
1 parent ea8bd323c7
commit 710f7c7086
5 files changed
+14 -5

No files matched your search

+5
View File
@@ -64,9 +64,14 @@ export interface EventMap extends Record<string, any> {
'handler/create': (thisArg: Handler) => VoidReturn
'handler/init': (thisArg: Handler) => VoidReturn
'handler/before-prepare/UserRegister': (thisArg: UserRegisterHandler) => VoidReturn
'handler/before-prepare': (thisArg: Handler) => VoidReturn
'handler/before/UserRegister': (thisArg: UserRegisterHandler) => VoidReturn
'handler/before': (thisArg: Handler) => VoidReturn
'handler/after/UserRegister': (thisArg: UserRegisterHandler) => VoidReturn
'handler/after': (thisArg: Handler) => VoidReturn
'handler/finish/UserRegister': (thisArg: UserRegisterHandler) => VoidReturn
'handler/finish': (thisArg: Handler) => VoidReturn
'handler/error': (thisArg: Handler) => VoidReturn
'handler/solution/get': (thisArg: ProblemSolutionHandler) => VoidReturn
'discussion/before-add': (payload: Partial<DiscussionDoc>) => VoidReturn
+2
View File
@@ -725,6 +725,8 @@ async function handle(ctx, HandlerClass, checker) {
await bail('handler/finish', h);
} catch (e) {
try {
await bail(`handler/error/${HandlerClass.name.replace(/Handler$/, '')}`, h);
await bail('handler/error', h);
await h.onerror(e);
} catch (err) {
h.response.code = 500;