HttpBadRequest

open class HttpBadRequest(val rawBody: String, message: String, cause: Throwable? = null) : PortalException.Api

Thrown when the backend responds with HTTP 400 Bad Request.

Surfaces from the transport layer (io.portalhq.android.utils.extensions.toTextResponse) for every SDK call site backed by io.portalhq.android.utils.PortalRequests or io.portalhq.android.utils.requesters.HttpRequester. Callers can branch on this to distinguish validation failures (400) from network/5xx failures, which surface as HttpRequestFailed.

Sibling, not subclass: HttpBadRequest is a sibling of HttpRequestFailed under Api. A catch (e: HttpRequestFailed) will NOT catch HttpBadRequest. Use catch (e: HttpBadRequest) (or the Api umbrella) explicitly.

Inheritors

Constructors

Link copied to clipboard
constructor(rawBody: String, message: String, cause: Throwable? = null)

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val message: String?
Link copied to clipboard

The raw 400 response body, useful for debugging or parsing structured backend error envelopes.