BetterErrors / BetterErrors/better_errors

Rails Logger not receiving exception with AJAX requests

Open
#429 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
6.9k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

I've seen other users mention that they're still running into issues with Ruby 2.5.x and Rails 5, and I'm in the same boat. However, the issue is that I'm not seeing _logged_ errors.

`better_errors` (2.5.0) and `binding_of_caller` (0.8.0) are both fully updated so I started debugging the issue and found the issue to be a result of `StackFrame` injecting gem names into the backtrace, which is then silenced by Rail's default BacktraceCleaner setup.

Specifically:

https://github.com/BetterErrors/better_errors/blob/master/lib/better_errors/stack_frame.rb#L39

is silenced by:

https://github.com/rails/rails/blob/master/railties/lib/rails/backtrace_cleaner.rb#L7 and https://github.com/rails/rails/blob/master/railties/lib/rails/backtrace_cleaner.rb#L19

What's got me a little stumped is that the relevant functionality has been part of both BetterErrors and Rails for a _very_ long time.

This is an issue with AJAX requests that fail. The BetterErrors prompt isn't shown because the HTML isn't displayed (no page reload, because AJAX). So I'm expecting that I can at least see the backtrace in the log. However, at present that's not happening.

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.