Skip to content

Preserve error_info when rescuing Erlang errors - #16241

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
lukaszsamson:codex/preserve-rescue-error-info
Nov 29, 2026
Merged

josevalim merged 1 commit into
elixir-lang:mainfrom
lukaszsamson:codex/preserve-rescue-error-info

Conversation

@lukaszsamson

Copy link
Copy Markdown
Contributor

Bare rescue e and rescue lists containing ErlangError previously passed the stacktrace to Exception.normalize/3 only for a fixed set of Erlang reasons. Pass it for every reason on this path so custom EEP 54 error_info can reach the existing formatter.

The regression tests attach distinct error_info.cause values and verify that each appears in the resulting exception message for bare rescue, ErlangError rescue, and a mixed rescue list. All three fail with the original translator. The exception, raise, and compiler error suites pass with the fix (207 tests and doctests).

@josevalim
josevalim merged commit aa65a09 into elixir-lang:main Nov 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants