Skip to content

Commit 29a6a4e

Browse files
committed
1 parent 1468352 commit 29a6a4e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/elixir/lib/exception.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ defmodule ErlangError do
27182718
{:ok, reason, IO.iodata_to_binary([":\n\n" | Enum.map(args_errors, &arg_error/1)])}
27192719

27202720
general = extra[:general] ->
2721-
{:ok, reason, ": " <> general}
2721+
{:ok, reason, ": " <> IO.chardata_to_string(general)}
27222722

27232723
true ->
27242724
:error

lib/elixir/test/elixir/exception_test.exs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ defmodule ExceptionTest do
5050
{:io, :put_chars, [self(), <<222>>],
5151
[error_info: %{module: __MODULE__, function: :dummy_error_extras}]}
5252
])
53+
54+
assert %ErlangError{
55+
original: {:failed_load_cacerts, :enoent},
56+
reason: ": Failed to load cacerts: operating system CA bundle could not be located"
57+
} =
58+
Exception.normalize(:error, {:failed_load_cacerts, :enoent}, [
59+
{:pubkey_os_cacerts, :get, 0,
60+
[
61+
file: ~c"pubkey_os_cacerts.erl",
62+
line: 53,
63+
error_info: %{cause: :enoent, module: :pubkey_os_cacerts}
64+
]}
65+
])
5366
end
5467

5568
test "format/2 without stacktrace" do

0 commit comments

Comments
 (0)