MCPcopy Create free account
hub / github.com/SplootCode/splootcode / logException

Method logException

python/executor.py:877–891  ·  view source on GitHub ↗
(self, exception)

Source from the content-addressed store, hash-verified

875 self.stack[-1].addExceptionResult(exceptionType, message, functionName)
876
877 def logException(self, exception):
878 exceptionType = str(type(exception).__name__)
879 message = str(exception)
880 traceback = exception.__traceback__.tb_next
881 functionName = None
882 if traceback.tb_next and traceback.tb_next.tb_frame.f_code.co_filename == 'main.py':
883 functionName = traceback.tb_next.tb_frame.f_code.co_name
884 self.stack[-1].addExceptionResult(exceptionType, message, functionName)
885
886 self.lastException = {"type": exceptionType, "message": message}
887 if exception in self.detachedFramesException:
888 func_id, frameno, lineno = self.detachedFramesException[exception]
889 self.lastException["func_id"] = func_id
890 self.lastException["frameno"] = frameno
891 self.lastException["lineno"] = lineno
892
893 def toDict(self):
894 cap = {"root": self.root.toDict(), "detached": {}}

Callers 1

executePythonFileFunction · 0.95

Calls 1

addExceptionResultMethod · 0.80

Tested by

no test coverage detected