Package org.omegazero.http.h2
Class HTTP2ConnectionError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.omegazero.http.common.HTTPException
org.omegazero.http.h2.HTTP2ConnectionError
- All Implemented Interfaces:
Serializable
Represents a HTTP/2 connection or stream error.
- Since:
- 1.2.1
- See Also:
- API Note:
- Despite the name, this class is an
Exception
(specifically aHTTPException
) not anError
. The name was chosen to align more closely with the terms used in the specification.
-
Constructor Summary
ConstructorsConstructorDescriptionHTTP2ConnectionError
(int status) Creates a newHTTP2ConnectionError
, as a connection error.HTTP2ConnectionError
(int status, boolean streamError) Creates a newHTTP2ConnectionError
.HTTP2ConnectionError
(int status, boolean streamError, String msg) Creates a newHTTP2ConnectionError
with the given message.HTTP2ConnectionError
(int status, String msg) Creates a newHTTP2ConnectionError
, as a connection error with the given message. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the status code passed in the constructor.static String
getStatusCodeName
(int status) Returns a string of the formatNAME [NUMBER]
, whereNAME
is the string name of the given status code, andNUMBER
is the given status code number.boolean
Returns whether this instance represents a stream or connection error, as configured in the constructor.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HTTP2ConnectionError
public HTTP2ConnectionError(int status) Creates a newHTTP2ConnectionError
, as a connection error.- Parameters:
status
- The status code
-
HTTP2ConnectionError
public HTTP2ConnectionError(int status, boolean streamError) Creates a newHTTP2ConnectionError
.- Parameters:
status
- The status codestreamError
- Whether this instance represents a stream or connection error
-
HTTP2ConnectionError
Creates a newHTTP2ConnectionError
, as a connection error with the given message.- Parameters:
status
- The status codemsg
- The error message
-
HTTP2ConnectionError
Creates a newHTTP2ConnectionError
with the given message.- Parameters:
status
- The status codestreamError
- Whether this instance represents a stream or connection errormsg
- The error message
-
-
Method Details
-
getStatus
public int getStatus()Returns the status code passed in the constructor.- Returns:
- The status code
-
isStreamError
public boolean isStreamError()Returns whether this instance represents a stream or connection error, as configured in the constructor.- Returns:
true
if this instance represents a stream error
-
getStatusCodeName
Returns a string of the formatNAME [NUMBER]
, whereNAME
is the string name of the given status code, andNUMBER
is the given status code number.- Parameters:
status
- The status code- Returns:
- The string
-