{"issue":{"state":"open","created_at":"2011-12-01T00:53:14Z","updated_at":"2011-12-01T01:44:19Z","comments":1,"user":{"gravatar_id":"5a0d7f0cb2fac7858d234de7f7f01491","id":8524,"url":"https://api.github.com/users/alexch","avatar_url":"https://secure.gravatar.com/avatar/5a0d7f0cb2fac7858d234de7f7f01491?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"alexch"},"body":"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. \r\n\r\nWe have...\r\n\r\nOAuth::Error < StandardError which is never used\r\n\r\nOAuth::Unauthorized < OAuth::Error which has a request but not a response\r\n\r\nOAuth::Problem < OAuth::Unauthorized which adds a \"problem\" string and \"params\" but then puts a *response* in the request field and leaves out the request\r\n\r\nThe \"problem\" string comes from http://wiki.oauth.net/ProblemReporting which is implemented by some providers... anyone know which ones?\r\n\r\nI 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. \r\n\r\nAnd 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?\r\n","assignee":null,"id":2409671,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"number":44,"title":"OAuth::Error hierarchy is weird","closed_at":null,"html_url":"https://github.com/oauth/oauth-ruby/issues/44","url":"https://api.github.com/repos/oauth/oauth-ruby/issues/44","milestone":null},"action":"created","comment":{"created_at":"2011-12-01T01:44:19Z","updated_at":"2011-12-01T01:44:19Z","user":{"gravatar_id":"a0b49382b6dcd9dd4602c3088717724e","id":45,"url":"https://api.github.com/users/mojodna","avatar_url":"https://secure.gravatar.com/avatar/a0b49382b6dcd9dd4602c3088717724e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"mojodna"},"body":"Agreed, the hierarchy is pretty weird.  It was a mid-point between no hierarchy (and no reporting of errors) and implementing the Problem Reporting extension (which I'd hoped more providers would support...CONSISTENTLY; seriously, the implementation variance in the wild is terrible).\r\n\r\nPlease do clean this up; it's my mess and I apologize (and I'm not in a position to do anything about it at this point).\r\n\r\nOAuth 1.0 isn't going away any time soon (it's actually quite different from OAuth 2.0 and serves a different purpose), so I think the time is certainly worth it.  Unless there's a cleaner implementation of OAuth 1.0 somewhere with more momentum behind it...","id":2969681,"url":"https://api.github.com/repos/oauth/oauth-ruby/issues/comments/2969681"}}