• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ExWeb3 / elixir_ethers / 9cfceb556fffaf94514444cf8bc33b79bd68085c

23 Apr 2025 10:27PM UTC coverage: 87.199%. Remained the same
9cfceb556fffaf94514444cf8bc33b79bd68085c

push

github

alisinabh
Fix changelog

1015 of 1164 relevant lines covered (87.2%)

122.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/lib/ethers/execution_error.ex
1
defmodule Ethers.ExecutionError do
2
  @moduledoc """
3
  Execution Error Exception.
4

5
  The Exception struct will have these values:
6

7
  - `message`: Human readable error message
8
  - `evm_error`: A custom error from the contract. (An Error Struct)
9
  """
10

11
  defexception [:message, :evm_error]
12

13
  @impl true
14
  def exception(%{"code" => _} = evm_error) do
15
    %__MODULE__{
11✔
16
      message: Map.get(evm_error, "message", "unknown error!"),
17
      evm_error: evm_error
18
    }
19
  end
20

21
  def exception(error) when is_exception(error), do: error
4✔
22

23
  def exception(error) when is_struct(error) do
24
    %__MODULE__{message: inspect(error), evm_error: error}
3✔
25
  end
26

27
  def exception(error) do
28
    %__MODULE__{message: "Unexpected error: #{maybe_inspect_error(error)}"}
28✔
29
  end
30

31
  defp maybe_inspect_error(error) when is_atom(error), do: Atom.to_string(error)
28✔
32
  defp maybe_inspect_error(error), do: inspect(error)
×
33
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc