(self, err: Exception)
| 315 | self.original = original |
| 316 | |
| 317 | def __call__(self, err: Exception): |
| 318 | result = None |
| 319 | if self.original: |
| 320 | result = self.original(err) |
| 321 | hook_result = None |
| 322 | for hook in HooksManager.get_hooks("error"): |
| 323 | hook_result = hook(err) |
| 324 | return result or hook_result |
| 325 | |
| 326 | @classmethod |
| 327 | def get_hooks(cls, hook: str): |