예제 #1
0
파일: exceptions.py 프로젝트: rlan/ray
 def from_bytes(b):
     ray_exception = RayException()
     ray_exception.ParseFromString(b)
     if ray_exception.language == PYTHON:
         return pickle.loads(ray_exception.serialized_exception)
     else:
         return CrossLanguageError(ray_exception)
예제 #2
0
 def from_bytes(b):
     ray_exception = RayException()
     ray_exception.ParseFromString(b)
     if ray_exception.language == PYTHON:
         try:
             return pickle.loads(ray_exception.serialized_exception)
         except Exception as e:
             msg = "Failed to unpickle serialized exception"
             raise RuntimeError(msg) from e
     else:
         return CrossLanguageError(ray_exception)
예제 #3
0
 def from_bytes(b):
     ray_exception = RayException()
     ray_exception.ParseFromString(b)
     return RayError.from_ray_exception(ray_exception)