BetterErrors / BetterErrors/better_errors

No backtrace available for ArgumentError

Open
#525 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
6.9k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

When using better_errors, I get no backtraces (and no REPL) for `ArgumentError` thrown from code. Forcing them with `raise` works fine.

I traced the problem back to `set_backtrace` not being called when the `ArgumentError` is caused by the code, but it is called when the error is forced with `raise`. The constructor is called in both instances

I saw some patch that added setting the backtrace to both the constructor and `set_backtrace`, but this code seems to be gone from the current release. Is there a reason for not patching the constructor any more?

Environment
* better_errors: 20.10.1
* binding_of_caller: 1.0.0
* rails: 7.0.7.2
* ruby: 3.2.2
* arch: arm64 (Mac M1)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.