intridea/oauth2 — Issue #80: Cannot set `:raise_errors => false` in a request when client has it set to `true`
Author: rewritten
Created: 2011-11-24 12:22:51+00:00
State: open

If the client is set to `:raise_errors => true`, then specific requests cannot override that value.

Use case: GoogleDocs API normally just returns data, but in some cases (e.g. resumable upload protocol) I need to access the exact error to know what to do next.

https://github.com/intridea/oauth2/blob/master/lib/oauth2/client.rb#L107:

```ruby
raise e if opts[:raise_errors] || options[:raise_errors]
```

should be:

```ruby
raise e if opts.fetch(:raise_errors, options[:raise_errors])
```

or

```ruby
raise e if opts.has_key?(:raise_errors) ? opts[:raise_errors] : options[:raise_errors])
```

so it does not fallback with a `false` value.