ServerError

data class ServerError(val statusCode: Int, val errorDescription: String) : NetworkingError

The server returned a non-2xx status code.

Constructors

Link copied to clipboard
constructor(statusCode: Int, errorDescription: String)

Properties

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

The raw response body, which may contain a Frame error envelope.

Link copied to clipboard

True for connectivity-class failures the user can retry. False for server-validation errors that should stay in the form so the user can correct the input.

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

The HTTP status code returned by the server.

Functions

Link copied to clipboard
fun toastMessage(fallback: String = "Something went wrong. Please try again."): String

User-facing message for the snackbar surface, prefixed with "Error: " for clarity. For ServerError, parses the standard Frame envelope ({"error_details":{"message":"…"},"error":"…"}) and prefers error_details.message. For transport-class errors or unparseable bodies, returns fallback prefixed the same way.