ThrowableOps

org.llm4s.error.ThrowableOps
object ThrowableOps

Extension methods for converting Throwable to domain-specific LLMError types.

Provides a uniform way to convert exceptions into the LLM4S error hierarchy, enabling consistent error handling across the codebase.

Attributes

Example
import org.llm4s.error.ThrowableOps._
val error = new java.net.SocketTimeoutException("timeout").toLLMError
// Returns NetworkError("Request timeout", ...)
// With custom mapper
implicit val mapper: ErrorMapper = customMapper
val customError = exception.toLLMError
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final implicit class RichThrowable(t: Throwable) extends AnyVal

Enriches Throwable with toLLMError conversion method.

Enriches Throwable with toLLMError conversion method.

Value parameters

t

The throwable to enrich

Attributes

Supertypes
class AnyVal
trait Matchable
class Any

Implicits

Implicits

final implicit def RichThrowable(t: Throwable): RichThrowable

Enriches Throwable with toLLMError conversion method.

Enriches Throwable with toLLMError conversion method.

Value parameters

t

The throwable to enrich

Attributes