MCPcopy
hub / github.com/ray-project/ray / from_ray_exception

Method from_ray_exception

python/ray/exceptions.py:47–62  ·  view source on GitHub ↗
(ray_exception)

Source from the content-addressed store, hash-verified

45
46 @staticmethod
47 def from_ray_exception(ray_exception):
48 if ray_exception.language == PYTHON:
49 try:
50 return pickle.loads(ray_exception.serialized_exception)
51 except Exception:
52 # formatted_exception_string is set in to_bytes() above by calling
53 # traceback.format_exception() on the original exception. It contains
54 # the string representation and stack trace of the original error.
55 original_stacktrace = getattr(
56 ray_exception,
57 "formatted_exception_string",
58 "No formatted exception string available.",
59 )
60 return UnserializableException(original_stacktrace)
61 else:
62 return CrossLanguageError(ray_exception)
63
64
65@PublicAPI

Callers 2

from_bytesMethod · 0.80

Calls 2

CrossLanguageErrorClass · 0.85

Tested by

no test coverage detected