]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/core-utils/plugins/hooks.ts
Merge branch 'master' into release/3.3.0
[github/Chocobozzz/PeerTube.git] / shared / core-utils / plugins / hooks.ts
index 60f4130f5b05adac67a858afe76d9fe3d4993376..5405e0529ad0eeab00bc08ed6cee44d84a8b5ef6 100644 (file)
@@ -8,7 +8,7 @@ function getHookType (hookName: string) {
   return HookType.STATIC
 }
 
-async function internalRunHook <T>(handler: Function, hookType: HookType, result: T, params: any, onError: (err: Error) => void) {
+async function internalRunHook <T> (handler: Function, hookType: HookType, result: T, params: any, onError: (err: Error) => void) {
   try {
     if (hookType === HookType.FILTER) {
       const p = handler(result, params)
@@ -29,7 +29,7 @@ async function internalRunHook <T>(handler: Function, hookType: HookType, result
     }
 
     if (hookType === HookType.ACTION) {
-      if (isCatchable(p)) p.catch(err => onError(err))
+      if (isCatchable(p)) p.catch((err: any) => onError(err))
 
       return undefined
     }