Package com.launchdarkly.eventsource
Class StreamHttpErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.launchdarkly.eventsource.StreamException
com.launchdarkly.eventsource.StreamHttpErrorException
- All Implemented Interfaces:
Serializable
An exception indicating that the remote server returned an HTTP error.
HttpConnectStrategy defines an error as any non-2xx status.
See StreamException for more about EventSource's exception behavior.
- Since:
- 4.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStreamHttpErrorException(int code) Constructs an instance.StreamHttpErrorException(int code, ResponseHeaders headers) Constructs an instance with response headers. -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Returns the HTTP status code.Returns the response headers from the failed HTTP request, or null if not available.Methods inherited from class com.launchdarkly.eventsource.StreamException
equals, hashCodeMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StreamHttpErrorException
public StreamHttpErrorException(int code) Constructs an instance.- Parameters:
code- the HTTP status
-
StreamHttpErrorException
Constructs an instance with response headers.- Parameters:
code- the HTTP statusheaders- the response headers, or null if not available- Since:
- 4.2.0
-
-
Method Details
-
getCode
public int getCode()Returns the HTTP status code.- Returns:
- the HTTP status
-
getHeaders
Returns the response headers from the failed HTTP request, or null if not available.- Returns:
- the response headers, or null
- Since:
- 4.2.0
-