public final class ExceptionHandler extends Object
| Modifier and Type | Method and Description |
|---|---|
<S extends Exception,T extends org.apache.thrift.TException> |
convertIfInstance(Class<S> source,
Class<T> target)
Converts the input exception to the target instance of class
target,
if the input exception is the instance of class source, throws the
converted target exception. |
MetaException |
defaultMetaException() |
RuntimeException |
defaultRuntimeException()
Converts the input exception to RuntimeException and returns.
|
org.apache.thrift.TException |
defaultTException() |
static ExceptionHandler |
handleException(Exception e) |
static MetaException |
newMetaException(Exception e)
Converts the input exception to MetaException and returns.
|
static void |
rethrowException(Exception e)
Throws if the input exception is the instance of MetaException, NoSuchObjectException or TException,
otherwise converts the exception to the MetaException and throws.
|
<T extends Exception> |
throwIfInstance(Class<T> t)
Throws if the input exception is the instance of the input class
|
<T1 extends Exception,T2 extends Exception> |
throwIfInstance(Class<T1> te1,
Class<T2> te2)
Throws if the input exception is the instance of the one in the input classes
|
<T1 extends Exception,T2 extends Exception,T3 extends Exception> |
throwIfInstance(Class<T1> te1,
Class<T2> te2,
Class<T3> te3)
Throws if the input exception is the instance of the one in the input classes
|
static void |
throwMetaException(Exception e)
Throws if the input exception is the instance of MetaException or NoSuchObjectException,
otherwise converts the exception to the MetaException and throws.
|
ExceptionHandler |
toMetaExceptionIfInstance(String message,
Class<?>... clzs)
Creates the MetaException with the given message,
if the input exception is the instance of the one in the input classes,
throws the created MetaException.
|
public static ExceptionHandler handleException(Exception e)
public <T extends Exception> ExceptionHandler throwIfInstance(Class<T> t) throws T extends Exception
T extends Exceptionpublic <T1 extends Exception,T2 extends Exception> ExceptionHandler throwIfInstance(Class<T1> te1, Class<T2> te2) throws T1 extends Exception, T2 extends Exception
T1 extends Exceptionpublic <T1 extends Exception,T2 extends Exception,T3 extends Exception> ExceptionHandler throwIfInstance(Class<T1> te1, Class<T2> te2, Class<T3> te3) throws T1 extends Exception, T2 extends Exception, T3 extends Exception
T1 extends Exceptionpublic <S extends Exception,T extends org.apache.thrift.TException> ExceptionHandler convertIfInstance(Class<S> source, Class<T> target) throws T extends org.apache.thrift.TException
target,
if the input exception is the instance of class source, throws the
converted target exception.T extends org.apache.thrift.TExceptionpublic ExceptionHandler toMetaExceptionIfInstance(String message, Class<?>... clzs) throws MetaException
MetaExceptionpublic static void rethrowException(Exception e) throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic static void throwMetaException(Exception e) throws MetaException, NoSuchObjectException
MetaExceptionNoSuchObjectExceptionpublic static MetaException newMetaException(Exception e)
public RuntimeException defaultRuntimeException()
public MetaException defaultMetaException()
public org.apache.thrift.TException defaultTException()
Copyright © 2024 The Apache Software Foundation. All rights reserved.