oauth/oauth-ruby — Issue #44: OAuth::Error hierarchy is weird
Author: alexch
Created: 2011-12-01 00:53:14+00:00
State: open

In trying to get a sensible error message to come out of a failed auth attempt (see https://github.com/oauth/oauth-ruby/pull/41 ) I had to resort to a heinous monkey patch since the OAuth::Error hierarchy is pretty weird.

We have...

OAuth::Error < StandardError which is never used

OAuth::Unauthorized < OAuth::Error which has a request but not a response

OAuth::Problem < OAuth::Unauthorized which adds a "problem" string and "params" but then puts a *response* in the request field and leaves out the request

The "problem" string comes from http://wiki.oauth.net/ProblemReporting which is implemented by some providers... anyone know which ones?

I suggest refactoring this so that all oauth errors allow the developer to see all the relevant info, including request and response headers and response body text, probably all in the exception message.

And I suppose I'm volunteering for this but I don't want to start coding without explicit approval since this gem (repo and mailing list) seems pretty dormant. And only supports OAuth 1.0 so maybe it's ready to retire?