Package net.corda.v5.base.exceptions
Class CordaRuntimeException
-
- All Implemented Interfaces:
-
java.io.Serializable
,net.corda.v5.base.exceptions.CordaThrowable
public class CordaRuntimeException extends RuntimeException implements CordaThrowable
Base class for all exceptions used for runtime error conditions in Corda.
This is the exception class that is used to throw and handle all exceptions you could encounter at runtime in a flow. This class and subclasses can be serialized by Corda and so are safe to throw in flows.
-
-
Field Summary
Fields Modifier and Type Field Description public String
originalExceptionClassName
public Throwable
cause
public Array<StackTraceElement>
stackTrace
-
Constructor Summary
Constructors Constructor Description CordaRuntimeException(String originalExceptionClassName, String message, Throwable cause)
Constructor used to wrap any exception in a safe way, taking the original exception class name, message and causes as parameters. CordaRuntimeException(String message, Throwable cause)
Constructor with just a message and a cause, for rethrowing exceptions that can be serialized. CordaRuntimeException(String message)
Constructor with just a message (creating a fresh execption).
-
Method Summary
Modifier and Type Method Description String
getOriginalExceptionClassName()
void
setOriginalExceptionClassName(@Nullable() String originalExceptionClassName)
String
getMessage()
Throwable
getCause()
void
setMessage(@Nullable() String message)
Allows to set the message after constructing the exception object. void
setCause(@Nullable() Throwable cause)
Allows to set a Throwable as cause after constructing the exception object. void
addSuppressed(@NotNull() Array<Throwable> suppressed)
String
getOriginalMessage()
int
hashCode()
boolean
equals(@Nullable() Object obj)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
CordaRuntimeException
CordaRuntimeException(String originalExceptionClassName, String message, Throwable cause)
Constructor used to wrap any exception in a safe way, taking the original exception class name, message and causes as parameters.
-
CordaRuntimeException
CordaRuntimeException(String message, Throwable cause)
Constructor with just a message and a cause, for rethrowing exceptions that can be serialized.
-
CordaRuntimeException
CordaRuntimeException(String message)
Constructor with just a message (creating a fresh execption).
-
-
Method Detail
-
getOriginalExceptionClassName
@Nullable() String getOriginalExceptionClassName()
- Returns:
The name of an exception that isn't serializable and therefore has been caught and converted to an exception in the Corda hierarchy.
-
setOriginalExceptionClassName
void setOriginalExceptionClassName(@Nullable() String originalExceptionClassName)
-
getMessage
@Nullable() String getMessage()
-
setMessage
void setMessage(@Nullable() String message)
Allows to set the message after constructing the exception object.
-
setCause
void setCause(@Nullable() Throwable cause)
Allows to set a Throwable as cause after constructing the exception object.
-
addSuppressed
void addSuppressed(@NotNull() Array<Throwable> suppressed)
-
getOriginalMessage
@Nullable() String getOriginalMessage()
- Returns:
Message of the original exception.
-
hashCode
int hashCode()
-
-
-
-