Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom errors #6

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Custom errors #6

wants to merge 16 commits into from

Conversation

reubenjs
Copy link

@reubenjs reubenjs commented Dec 6, 2020

The errors raised are just an instance of RuntimeError. It would be more useful to have custom errors defined by the gem so that they could be handled in a more readable way.

For example, when checking if a contact (still) exists, if the answer is no, a Saasu::ResourceNotFoundError will be thrown.

Example code would be

      begin 
        Saasu::Contact.find(contact.saasu_uid)
      rescue Saasu::ResourceNotFoundError
        add_to_saasu(contact)
      end

reubenjs and others added 16 commits December 6, 2016 10:59
Allow setting of PageSize and Page
Update search filters to match current API
…ng rails >4. basecamp have backported these functions, so add their gem as a dependency
Incorporate Osseta's improvements into my fork
…ore useful to have custom errors defined by the gem so that they could be handled in a more readable way.

For example, when checking if a contact (still) exists, if the answer is no, a Saasu::ResourceNotFoundError will be thrown.
… with Faraday. there is probably a better way to do this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants