Packages

Elixir SDK for the Stellar network.

Current section

Files

Jump to
stellar_sdk_fork lib horizon collection_error.ex
Raw

lib/horizon/collection_error.ex

defmodule Stellar.Horizon.CollectionError do
@moduledoc """
Handle exceptions that may arise from the `Stellar.Horizon.Collection`.
"""
@type t :: %__MODULE__{message: String.t()}
defexception [:message]
@spec exception(type :: atom()) :: no_return()
def exception(:invalid_collection),
do: %__MODULE__{message: "can't parse response as a collection"}
def exception(message), do: %__MODULE__{message: message}
end