intridea/oauth2 — pull request #92 by goofrider (2012-02-24 09:19:37+00:00)
Title: Mo better errors

Expand on Pull #89 "Provide more descriptive exception messages" (djanowski).

https://github.com/intridea/oauth2/pull/89

Move set @code and @desription in a separate set_response_code method so it can be overriden by subclass with overriding the whole initialize() method. As other OAuth2 providers may use non-standard key names for errors.

An example for a subclass of OAuth2::Error that needs to change the error @code/@description setters.

https://github.com/acenqiu/weibo2/blob/master/lib/weibo2/error.rb