Error

data class Error<out T>(val message: String, val throwable: Throwable? = null, val statusCode: Int = 0) : LocalzResult<T>

Represents a failed operation with error details.

Constructors

Link copied to clipboard
constructor(message: String, throwable: Throwable? = null, statusCode: Int = 0)

Properties

Link copied to clipboard

A human-readable description of the error.

Link copied to clipboard
val statusCode: Int = 0

HTTP status code or other numeric error code, if applicable.

Link copied to clipboard
val throwable: Throwable? = null

The original exception that caused the error, if available.

Functions

Link copied to clipboard

Maps a result of any type to a result with a Unit payload, preserving success/error status.

Link copied to clipboard

Maps an Error of one generic type to an Error of another generic type.