← Back to Kairo Docs|API Reference (Dokka)

LogicalFailure

abstract class LogicalFailure(message: String, cause: Throwable? = null) : Exception

"Logical failures" describe situations not deemed successful in your domain, but still within the realms of that domain. For example, a user record not being found is a logical failure, not a real exception. Whereas a network timeout or stack overflow is a "real exception".

Roughly conforms to RFC 9457, but not strictly.

Constructors

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

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val detail: String? = null

Additional human-readable context that varies per occurrence.

Link copied to clipboard
open val json: Map<String, Any?>

Lazily-computed JSON representation of this failure, roughly conforming to RFC 9457.

Link copied to clipboard
Link copied to clipboard
open val message: String?
Link copied to clipboard
Link copied to clipboard
abstract val status: HttpStatusCode

The HTTP status code this failure maps to.

Link copied to clipboard
Link copied to clipboard
abstract val type: String

Machine-readable discriminator for this failure type (for example "UserNotFound").