Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outside of rack processing #9

Closed
solutus opened this issue Dec 30, 2013 · 3 comments
Closed

Outside of rack processing #9

solutus opened this issue Dec 30, 2013 · 3 comments

Comments

@solutus
Copy link

solutus commented Dec 30, 2013

Hello. I suggest to add checking if(RailsExceptionHandler.configuration.activate?)
to manual exception handling in order to tests are running if RailsExceptionHandler is only for production mode.
https://github.com/Sharagoz/rails_exception_handler/wiki/Manual-exception-handling-outside-of-rack

@bjorntrondsen
Copy link
Owner

Good idea!

@bjorntrondsen
Copy link
Owner

I didnt like how intrucive the manual exception handling was, so I added a helper method for this in version 2.3.3. Simply wrap the code with a call to the exception handler like so

RailsExceptionHandler.catch do
  # Code that runs outside of Rack
end

The exception will only be caught and stored if the exception handler is activated. so the errors will be raised like normal in development and test.

@solutus
Copy link
Author

solutus commented Jan 8, 2014

Thanks! Will use it.

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

No branches or pull requests

2 participants