| 49 | |
| 50 | |
| 51 | class CaptureErrors: |
| 52 | def __init__(self, output): |
| 53 | self.output = output |
| 54 | |
| 55 | def __enter__(self): |
| 56 | pass |
| 57 | |
| 58 | def __exit__(self, exc_type, exception, traceback): |
| 59 | if exc_type is not None: |
| 60 | self.output.append({"type": "backend-error", "payload": str(exception)}) |
| 61 | return True |
| 62 | |
| 63 | |
| 64 | class WorkerProcess(Process): |