public class CloseException extends RuntimeException
Used to wrap an underlying websocket CloseStatus so clients can retrieve the
status code and perform actions after it.
| Constructor and Description |
|---|
CloseException(CloseStatus closeStatus,
Context context)
Create a
CloseException with the given status and Reactor context. |
CloseException(CloseStatus closeStatus,
Context context,
Throwable cause)
Create a
CloseException with the given status, Reactor context and cause. |
| Modifier and Type | Method and Description |
|---|---|
CloseStatus |
getCloseStatus()
Return the underlying
CloseStatus that triggered this exception. |
int |
getCode()
Return the websocket close code.
|
Context |
getContext()
Return the Reactor
Context providing metadata about this exception. |
String |
getMessage() |
Optional<String> |
getReason()
Return a websocket close reason, if present.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic CloseException(CloseStatus closeStatus, Context context)
CloseException with the given status and Reactor context.closeStatus - the CloseStatus representing this exceptioncontext - a Context instance representing metadata related to this exceptionpublic CloseException(CloseStatus closeStatus, Context context, @Nullable Throwable cause)
CloseException with the given status, Reactor context and cause.closeStatus - the CloseStatus representing this exceptioncontext - a Context instance providing metadata related to this exceptioncause - the cause for this exceptionpublic CloseStatus getCloseStatus()
CloseStatus that triggered this exception.public int getCode()
public Optional<String> getReason()
Optional containing a close reason if present, or empty otherwisepublic Context getContext()
Context providing metadata about this exception.public String getMessage()
getMessage in class Throwable