File tree Expand file tree Collapse file tree 2 files changed +3
-22
lines changed Expand file tree Collapse file tree 2 files changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -1743,26 +1743,7 @@ defmodule Kernel do
1743
1743
1744
1744
message ->
1745
1745
quote do
1746
- stacktrace = unquote ( stacktrace )
1747
-
1748
- case unquote ( message ) do
1749
- message when is_binary ( message ) ->
1750
- :erlang . raise ( :error , RuntimeError . exception ( message ) , stacktrace )
1751
-
1752
- atom when is_atom ( atom ) ->
1753
- :erlang . raise ( :error , atom . exception ( [ ] ) , stacktrace )
1754
-
1755
- % _ { __exception__: true } = other ->
1756
- :erlang . raise ( :error , other , stacktrace )
1757
-
1758
- other ->
1759
- message = <<
1760
- "reraise/2 expects a module name, string or exception" ,
1761
- "as the first argument, got: #{ inspect ( other ) } "
1762
- >>
1763
-
1764
- :erlang . error ( ArgumentError . exception ( message ) )
1765
- end
1746
+ :erlang . raise ( :error , Kernel.Utils . raise ( unquote ( message ) ) , unquote ( stacktrace ) )
1766
1747
end
1767
1748
end
1768
1749
end
Original file line number Diff line number Diff line change @@ -135,8 +135,8 @@ defmodule Kernel.Utils do
135
135
136
136
def raise ( other ) do
137
137
ArgumentError . exception (
138
- "raise/1 expects a module name, string or exception as " <>
139
- "the first argument, got: #{ inspect ( other ) } "
138
+ "raise/1 and reraise/2 expect a module name, string or exception " <>
139
+ "as the first argument, got: #{ inspect ( other ) } "
140
140
)
141
141
end
142
142
You can’t perform that action at this time.
0 commit comments