public class UaException extends Exception implements UaExceptionStatus
Constructor and Description |
---|
UaException(long statusCode) |
UaException(long statusCode,
String message) |
UaException(long statusCode,
Throwable cause) |
UaException(StatusCode statusCode) |
UaException(StatusCode statusCode,
String message) |
UaException(Throwable cause) |
Modifier and Type | Method and Description |
---|---|
static Optional<UaException> |
extract(Throwable ex)
If
ex is a UaException , or if a UaException can be found by walking up the exception
cause chain, return it. |
static Optional<StatusCode> |
extractStatusCode(Throwable ex) |
String |
getMessage() |
StatusCode |
getStatusCode() |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public UaException(long statusCode)
public UaException(StatusCode statusCode)
public UaException(Throwable cause)
public UaException(long statusCode, Throwable cause)
public UaException(long statusCode, String message)
public UaException(StatusCode statusCode, String message)
public StatusCode getStatusCode()
getStatusCode
in interface UaExceptionStatus
StatusCode
associated with the exception.public String getMessage()
getMessage
in interface UaExceptionStatus
getMessage
in class Throwable
public static Optional<UaException> extract(Throwable ex)
ex
is a UaException
, or if a UaException
can be found by walking up the exception
cause chain, return it.extract
in interface UaExceptionStatus
ex
- the Throwable
to extract from.UaException
if one was present in the exception chain.public static Optional<StatusCode> extractStatusCode(Throwable ex)
Copyright © 2020. All rights reserved.