Package io.getstream.exceptions
Class StreamException
java.lang.Object
java.lang.Throwable
java.lang.Exception
io.getstream.exceptions.StreamException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
StreamApiException,StreamTaskException,StreamTransportException,Webhook.InvalidWebhookError
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionStreamException(String message, StreamException.ResponseData responseData) StreamException(String message, Throwable t) -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamExceptionBuilds a StreamException to signal an issuestatic StreamExceptionBuilds a StreamException when an exception occurs calling the API.static StreamExceptionbuild(okhttp3.Response httpResponse) Builds a typed API exception from an HTTP response.static StreamExceptionbuild(okhttp3.ResponseBody responseBody) Builds a typed API exception from the Stream API error body.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StreamException
-
StreamException
-
StreamException
-
-
Method Details
-
build
Builds a StreamException to signal an issue- Parameters:
issue- the issue- Returns:
- the StreamException
-
build
Builds a typed API exception from the Stream API error body.Parseable
APIErrorenvelope →StreamApiException; unparseable body but HTTP layer succeeded →StreamApiExceptionwithcode=0and the raw body preserved.This overload does not see the status code; callers that have a
Responseshould preferbuild(Response)so 429 is routed toStreamRateLimitExceptionandstatusCodeis preserved. -
build
Builds a typed API exception from an HTTP response. 429 →StreamRateLimitExceptionwithRetry-Afterparsed per RFC 7231 §7.1.3 (integer seconds or HTTP-date). Other 4xx/5xx →StreamApiException. -
build
Builds a StreamException when an exception occurs calling the API.Historic factory preserved for back-compat. The HTTP-call path now classifies transport failures directly via
StreamTransportException.fromIOException(IOException)so this factory no longer auto-routes; it simply wraps the cause.- Parameters:
t- the underlying exception- Returns:
- the StreamException
-