Skip to content

Conversation

@eugeneius
Copy link
Contributor

Instead of adding the hook to report debugged exceptions based on the value of the configuration option while Rails is initialising, we can always add the hook, but have it check the option at runtime. This is more in line with how other configuration options are used, and means that the option can be set or changed at any time, which would have prevented #458.

This also lets us write tests that exercise this behaviour, since the logic is no longer tied to the Rails initialisation process, which can only happen once during the test suite.

@eugeneius eugeneius force-pushed the check_catch_debugged_exceptions_at_runtime branch 2 times, most recently from 16b8af0 to bf5e881 Compare February 16, 2016 14:24
Instead of adding the hook to report debugged exceptions based on the
value of the configuration option while Rails is initialising, we can
always add the hook, but have it check the option at runtime. This is
more in line with how other configuration options are used, and means
that the option can be set or changed at any time.

This also lets us write tests that exercise this behaviour, since the
logic is no longer tied to the Rails initialisation process which can
only happen once during the test suite.
@nateberkopec
Copy link
Contributor

Punting on this for 0.15.6. It feels really weird that we inject our middleware no matter what here.

@nateberkopec
Copy link
Contributor

Yeah, I'm not comfortable with this. I think the long term fix for making this testable is probably related to #462, because working with this singleton Raven configuration in our tests is making us bend over backwards. We should fix how we deal with this in the tests rather than the code.

@eugeneius
Copy link
Contributor Author

👍

@eugeneius
Copy link
Contributor Author

Thinking about this some more, testing this code is difficult because Rails is a singleton, not Raven - addressing #462 won't make it any easier.

Interestingly, Rails had the same choice to make with ActionDispatch::ShowExceptions - it doesn't do anything unless env['action_dispatch.show_exceptions'] is set, but it's always included anyway.

alexford pushed a commit to alexford/raven-ruby that referenced this pull request Jan 1, 2017
…follow_up

[test] Simplified httpclient_test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants