mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add constant to error page
This commit is contained in:
1 parent
ea8bd323c7
commit
710f7c7086
5 files changed
+14
-5
No files matched your search
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user