Ollixir.Errors (Ollixir v0.1.1)

Copy Markdown View Source

Error handling utilities for Ollixir.

Error Types

Summary

Functions

Get error message from any error type.

Format error for logging.

Check if an error is retryable.

Wrap a function result, converting errors to appropriate types.

Functions

error_message(e)

Get error message from any error type.

format_for_log(e)

Format error for logging.

retryable?(e)

Check if an error is retryable.

wrap(success)

@spec wrap(term()) ::
  {:ok, term()}
  | {:error,
     Ollixir.ConnectionError.t()
     | Ollixir.RequestError.t()
     | Ollixir.ResponseError.t()}

Wrap a function result, converting errors to appropriate types.