Class UaException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.eclipse.milo.opcua.stack.core.UaException
- All Implemented Interfaces:
Serializable,UaExceptionStatus
- Direct Known Subclasses:
UaServiceFaultException
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUaException(long statusCode) UaException(long statusCode, String message) UaException(long statusCode, String message, Throwable cause) UaException(long statusCode, Throwable cause) UaException(Throwable cause) Creates a new UaException with a cause.UaException(StatusCode statusCode) UaException(StatusCode statusCode, String message) -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<UaException>Ifexis aUaException, or if aUaExceptioncan be found by walking up the exception cause chain, return it.static Optional<StatusCode>toString()Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
UaException
public UaException(long statusCode) -
UaException
-
UaException
Creates a new UaException with a cause.The StatusCode is extracted from the cause or any of its nested causes by looking for an implementation of
UaExceptionStatus, otherwiseStatusCodes0.Bad_UnexpectedErroris used.- Parameters:
cause- the cause of this exception.
-
UaException
-
UaException
-
UaException
-
UaException
-
-
Method Details
-
getStatusCode
- Specified by:
getStatusCodein interfaceUaExceptionStatus- Returns:
- the
StatusCodeassociated with the exception.
-
getMessage
- Specified by:
getMessagein interfaceUaExceptionStatus- Overrides:
getMessagein classThrowable- Returns:
- the message associated with the exception.
-
toString
-
extract
Ifexis aUaException, or if aUaExceptioncan be found by walking up the exception cause chain, return it.- Parameters:
ex- theThrowableto extract from.- Returns:
- a
UaExceptionif one was present in the exception chain.
-
extractStatusCode
-