[api] Second round of 1.0 API changes: exceptions, num_return_vals (#10377)

This commit is contained in:
Eric Liang
2020-08-28 19:57:02 -07:00
committed by GitHub
parent b1f3c9e10e
commit 2a204260a8
37 changed files with 180 additions and 204 deletions
+6 -7
View File
@@ -13,9 +13,9 @@ from ray.exceptions import (
PlasmaObjectNotAvailable,
RayTaskError,
RayActorError,
RayCancellationError,
RayWorkerError,
UnreconstructableError,
TaskCancelledError,
WorkerCrashedError,
ObjectLostError,
)
from ray._raylet import (
split_buffer,
@@ -265,14 +265,13 @@ class SerializationContext:
obj = self._deserialize_msgpack_data(data, metadata)
return RayError.from_bytes(obj)
elif error_type == ErrorType.Value("WORKER_DIED"):
return RayWorkerError()
return WorkerCrashedError()
elif error_type == ErrorType.Value("ACTOR_DIED"):
return RayActorError()
elif error_type == ErrorType.Value("TASK_CANCELLED"):
return RayCancellationError()
return TaskCancelledError()
elif error_type == ErrorType.Value("OBJECT_UNRECONSTRUCTABLE"):
return UnreconstructableError(
ray.ObjectRef(object_ref.binary()))
return ObjectLostError(ray.ObjectRef(object_ref.binary()))
else:
assert error_type != ErrorType.Value("OBJECT_IN_PLASMA"), \
"Tried to get object that has been promoted to plasma."