Skip to content

Comments

Created custom exceptions#3

Open
dansingerman wants to merge 1 commit intoryanjarvinen:masterfrom
dansingerman:add_custom_exceptions
Open

Created custom exceptions#3
dansingerman wants to merge 1 commit intoryanjarvinen:masterfrom
dansingerman:add_custom_exceptions

Conversation

@dansingerman
Copy link

Hi,

I have created a pull request to throw custom exceptions so that code like the following is possible:

  try {
    $resp = $client->event_search($search_params);
  }
  catch (EventbriteException $e) {
    // Deal with API errors.
  }
  catch (Exception $e) {
    // Deal with generic PHP or connectivity errors here.
  }

This makes it possible to deal with errors returned from the Eventbrite API differently to those thrown by other code.

I have put the custom exceptions in the main Eventbrite.php file as it is all currently self-contained there, so let me know if you think they should be in separate file(s) to be required.

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.

1 participant