示例#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)