Current section

Files

Jump to
bingex lib bingex http error.ex
Raw

lib/bingex/http/error.ex

defmodule Bingex.HTTP.Error do
@moduledoc """
Represents an HTTP error when communicating with the BingX API.
This module defines a custom exception for handling HTTP-related errors,
encapsulating the reason for the failure.
"""
@type t() :: %__MODULE__{reason: term()}
defexception [:reason]
@impl true
def exception(reason) when is_atom(reason) do
%__MODULE__{reason: reason}
end
@impl true
def message(%__MODULE__{reason: reason}) do
"#{reason}"
end
end