Cross language exception (#10023)

This commit is contained in:
fyrestone
2020-08-26 10:46:05 +08:00
committed by GitHub
parent 1e99b814f0
commit 08adbb371f
30 changed files with 441 additions and 137 deletions
@@ -1,15 +0,0 @@
package io.ray.api.exception;
/**
* Indicates that the actor died unexpectedly before finishing a task.
*
* This exception could happen either because the actor process dies while executing a task, or
* because a task is submitted to a dead actor.
*/
public class RayActorException extends RayException {
public RayActorException() {
super("The actor died unexpectedly before finishing this task.");
}
}
@@ -1,15 +0,0 @@
package io.ray.api.exception;
/**
* Base class of all ray exceptions.
*/
public class RayException extends RuntimeException {
public RayException(String message) {
super(message);
}
public RayException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -1,15 +0,0 @@
package io.ray.api.exception;
/**
* Indicates that a task threw an exception during execution.
*
* If a task throws an exception during execution, a RayTaskException is stored in the object store
* as the task's output. Then when the object is retrieved from the object store, this exception
* will be thrown and propagate the error message.
*/
public class RayTaskException extends RayException {
public RayTaskException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -1,12 +0,0 @@
package io.ray.api.exception;
/**
* Indicates that the worker died unexpectedly while executing a task.
*/
public class RayWorkerException extends RayException {
public RayWorkerException() {
super("The worker died unexpectedly while executing this task.");
}
}
@@ -1,23 +0,0 @@
package io.ray.api.exception;
import io.ray.api.id.ObjectId;
/**
* Indicates that an object is lost (either evicted or explicitly deleted) and cannot be
* restarted.
*
* Note, this exception only happens for actor objects. If actor's current state is after object's
* creating task, the actor cannot re-run the task to reconstruct the object.
*/
public class UnreconstructableException extends RayException {
public final ObjectId objectId;
public UnreconstructableException(ObjectId objectId) {
super(String.format(
"Object %s is lost (either evicted or explicitly deleted) and cannot be reconstructed.",
objectId));
this.objectId = objectId;
}
}