Http Request Failed
class HttpRequestFailed(message: String, cause: Throwable? = null, val statusCode: Int? = null) : PortalException.Api
Thrown when an HTTP request fails with a non-success status code other than 400 (which throws HttpBadRequest) or 401 (which throws HttpUnauthorized). Covers 4xx ≥ 402, all 5xx, and unknown status codes.
Properties
Link copied to clipboard
The HTTP status code that produced this failure, when known. Populated by io.portalhq.android.utils.extensions.toTextResponse for real HTTP responses (null for synthesized failures such as a 200 body that carried an error envelope, or when no valid HTTP response was received). Callers can branch on this to distinguish transient server-side (5xx) failures from terminal 4xx failures.