Failure

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

Represents a failed result encapsulating an error message.

This class extends the base Result interface and is used to indicate that a particular operation has failed. The associated failure message provides additional context or details about the failure.

Parameters

TResult

The type of the tool result associated with the operation.

Constructors

Link copied to clipboard
constructor(message: String)

Properties

Link copied to clipboard
open override val content: String

Returns the failure message associated with this 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.