Failure

data class Failure<TResult>(val message: String) : SafeTool.Result<TResult> (source)

Represents a failed result encapsulating an error message.

Type Parameters

TResult

The type of the tool result.

Constructors

Link copied to clipboard
constructor(message: String)

Properties

Link copied to clipboard
open override val content: String

Content of the result

Link copied to clipboard

A descriptive error message explaining the reason for the failure.

Functions

Link copied to clipboard

Casts the current object to a Failure type.

Link copied to clipboard

Casts the current instance of Result to a Success type if it is a successful result.

Link copied to clipboard
open fun isFailure(): Boolean

Determines whether the current instance represents a failure state.

Link copied to clipboard
open fun isSuccessful(): Boolean

Determines if the current result represents a successful operation.