Package ej.websocket
Class ServerException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ej.websocket.WebSocketException
-
- ej.websocket.ServerException
-
- All Implemented Interfaces:
Serializable
public class ServerException extends WebSocketException
This is a more specificWebSocketExceptiontype. It is thrown during when the error is caused by the server (such as an invalid HTTP status code during the opening handshake).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServerException()ServerException(String string)Create a new server exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHttpStatusCode()Get the the HTTP status code returned by the server.voidsetHttpStatusCode(int httpStatusCode)Set the the HTTP status code returned by the server.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, toString
-
-
-
-
Constructor Detail
-
ServerException
public ServerException(String string)
Create a new server exception.- Parameters:
string- message to describe the error case
-
ServerException
public ServerException()
-
-
Method Detail
-
getHttpStatusCode
public int getHttpStatusCode()
Get the the HTTP status code returned by the server.- Returns:
- the status code ; 0 if the code could not be determined
-
setHttpStatusCode
public void setHttpStatusCode(int httpStatusCode)
Set the the HTTP status code returned by the server.- Parameters:
httpStatusCode- the status code
-
-