Package org.apache.guacamole
Class GuacamoleException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.guacamole.GuacamoleException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GuacamoleClientException
,GuacamoleServerException
,GuacamoleUpstreamException
public class GuacamoleException extends Exception
A generic exception thrown when parts of the Guacamole API encounter errors.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GuacamoleException(String message)
Creates a new GuacamoleException with the given message.GuacamoleException(String message, Throwable cause)
Creates a new GuacamoleException with the given message and cause.GuacamoleException(Throwable cause)
Creates a new GuacamoleException with the given cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHttpStatusCode()
Returns the most applicable HTTP status code that can be associated with this exception.GuacamoleStatus
getStatus()
Returns the Guacamole status associated with this exception.int
getWebSocketCode()
Returns the most applicable WebSocket status code that can be associated with this exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
GuacamoleException
public GuacamoleException(String message, Throwable cause)
Creates a new GuacamoleException with the given message and cause.- Parameters:
message
- A human readable description of the exception that occurred.cause
- The cause of this exception.
-
GuacamoleException
public GuacamoleException(String message)
Creates a new GuacamoleException with the given message.- Parameters:
message
- A human readable description of the exception that occurred.
-
GuacamoleException
public GuacamoleException(Throwable cause)
Creates a new GuacamoleException with the given cause.- Parameters:
cause
- The cause of this exception.
-
-
Method Detail
-
getStatus
public GuacamoleStatus getStatus()
Returns the Guacamole status associated with this exception. This status can then be easily translated into an HTTP error code or Guacamole protocol error code.- Returns:
- The corresponding Guacamole status.
-
getHttpStatusCode
public int getHttpStatusCode()
Returns the most applicable HTTP status code that can be associated with this exception.- Returns:
- An integer representing the most applicable HTTP status code associated with this exception.
-
getWebSocketCode
public int getWebSocketCode()
Returns the most applicable WebSocket status code that can be associated with this exception.- Returns:
- An integer representing the most applicable WebSocket status code associated with this exception.
-
-