nateleavitt/infusionsoft — pull request #9 by denniskuczynski (2012-09-21 20:15:21+00:00)
Title: Modify Connection to throw exceptions up to the client

Would you be open to changing the error handling behavior to something like this?

I recently was testing code, and I passed in an invalid custom attribute name, e..g:

```ruby
selected_fields = ['Id', 'FirstName', 'LastName', '_Invalid']
contact = Infusionsoft.contact_find_by_email('user@example.com', selected_fields)
```

contact_find_by_email just returned nil, because Connection was not bubbling up the underlying exception, so I could not programmatically check what went wrong.

This might break backwards compatibility for users that just check for nil for error detection, so this behavior could be enabled by a configuration option as well. (If you didn't want it as the default behavior.)

Let me know what you think,
Thanks,
Dennis