Package alluxio.exception.runtime
Class AlluxioRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- alluxio.exception.runtime.AlluxioRuntimeException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AlreadyExistsRuntimeException
,CancelledRuntimeException
,DeadlineExceededRuntimeException
,FailedPreconditionRuntimeException
,InternalRuntimeException
,InvalidArgumentRuntimeException
,NotFoundRuntimeException
,OutOfRangeRuntimeException
,PermissionDeniedRuntimeException
,ResourceExhaustedRuntimeException
,UnauthenticatedRuntimeException
,UnavailableRuntimeException
,UnimplementedRuntimeException
,UnknownRuntimeException
public class AlluxioRuntimeException extends java.lang.RuntimeException
Alluxio RuntimeException. This Every developer should throw this kind of exception when you really need to throw exception and surface this exception to user or when you want to catch low level exception from external dependency and transform it into AlluxioRuntimeException. There are 3 ways of using this class here: 1. Carefully pick a convenient class likeInternalRuntimeException
. 2. Throw new AlluxioRuntimeException directly. 3. Try not to use AlluxioRuntimeException.from(cause). This method used when you catch a very general cause(ex.IOException
) and is mainly for compatibility- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AlluxioRuntimeException(io.grpc.Status status, java.lang.String message, java.lang.Throwable cause, alluxio.grpc.ErrorType errorType, boolean retryable, com.google.protobuf.Any... details)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AlluxioRuntimeException
from(AlluxioStatusException t)
Converts an arbitrary AlluxioStatusException to an Alluxio runtime exception.static AlluxioRuntimeException
from(java.io.IOException ioe)
Converts an IOException to a corresponding runtime exception.static AlluxioRuntimeException
from(java.lang.RuntimeException t)
Converts an arbitrary RuntimeException to an Alluxio runtime exception.static AlluxioRuntimeException
from(java.lang.Throwable t)
Converts an arbitrary throwable to an Alluxio runtime exception.java.lang.String
getMessage()
io.grpc.Status
getStatus()
boolean
isRetryable()
io.grpc.StatusException
toGrpcStatusException()
io.grpc.StatusRuntimeException
toGrpcStatusRuntimeException()
-
-
-
Constructor Detail
-
AlluxioRuntimeException
public AlluxioRuntimeException(io.grpc.Status status, java.lang.String message, @Nullable java.lang.Throwable cause, alluxio.grpc.ErrorType errorType, boolean retryable, @Nullable com.google.protobuf.Any... details)
- Parameters:
status
- the grpc status code for this exceptionmessage
- the error messagecause
- the exceptionerrorType
- error typeretryable
- client can retry or notdetails
- the additional information needed
-
-
Method Detail
-
getStatus
public io.grpc.Status getStatus()
- Returns:
- grpc status
-
isRetryable
public boolean isRetryable()
- Returns:
- can be retried or not
-
toGrpcStatusException
public io.grpc.StatusException toGrpcStatusException()
- Returns:
- a gRPC status exception representation of this exception
-
toGrpcStatusRuntimeException
public io.grpc.StatusRuntimeException toGrpcStatusRuntimeException()
- Returns:
- a gRPC status runtime exception representation of this exception
-
from
public static AlluxioRuntimeException from(java.lang.Throwable t)
Converts an arbitrary throwable to an Alluxio runtime exception.- Parameters:
t
- exception- Returns:
- alluxio runtime exception
-
from
public static AlluxioRuntimeException from(java.lang.RuntimeException t)
Converts an arbitrary RuntimeException to an Alluxio runtime exception.- Parameters:
t
- exception- Returns:
- alluxio runtime exception
-
from
public static AlluxioRuntimeException from(AlluxioStatusException t)
Converts an arbitrary AlluxioStatusException to an Alluxio runtime exception.- Parameters:
t
- exception- Returns:
- alluxio runtime exception
-
from
public static AlluxioRuntimeException from(java.io.IOException ioe)
Converts an IOException to a corresponding runtime exception.- Parameters:
ioe
- the IO exception to convert- Returns:
- the corresponding status exception
-
getMessage
@Nullable public java.lang.String getMessage()
- Overrides:
getMessage
in classjava.lang.Throwable
-
-