MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / CaptureErrors

Class CaptureErrors

pythonwhat/local.py:51–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51class 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
64class WorkerProcess(Process):

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected