intridea/omniauth — Issue #578: Improve Error Handling
Author: mbleigh
Created: 2012-02-21 14:47:53+00:00
State: open

Right now OmniAuth is a bit too much of a rabbit hole when it comes to error handling. I propose that the default error strategy be updated to be a little more robust:

1. Create a new configuration option `raise_exceptions` that accepts a boolean value or a lambda. By default, it should be a lambda that evaluates to `true` unless `RACK_ENV` is development.
2. Alter the default failure endpoint to raise the exception stored in `omniauth.error` if it exists, or raise an `OmniAuth::Error` with as much info as possible **only if raise_exceptions is true** in environments not development, no change to the strategy will take place.