We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d93c95 commit 07cfbecCopy full SHA for 07cfbec
lib/splode/error.ex
@@ -54,10 +54,26 @@ defmodule Splode.Error do
54
@impl Splode.Error
55
def error_class?, do: @error_class
56
57
- def exception, do: exception([])
+ field_names =
58
+ Enum.map(List.wrap(opts[:fields]), fn
59
+ {k, _v} ->
60
+ k
61
+
62
+ k ->
63
64
+ end)
65
66
@impl Exception
- def exception(opts) do
67
+ @doc """
68
+ Create an `#{__MODULE__}` without raising it.
69
70
71
+ ## Keys
72
73
+ #{Enum.map_join(field_names, "\n", &"- #{inspect(&1)}")}
74
+ """
75
+ @spec exception(opts :: Keyword.t()) :: %__MODULE__{}
76
+ def exception(opts \\ []) do
77
if @error_class && match?([%error{class: :special} = special], opts[:errors]) do
78
special_error = Enum.at(opts[:errors], 0)
79
0 commit comments