bugsnag / bugsnag-api-ruby

BugSnag API toolkit for Ruby
Other
21 stars 15 forks source link

Handle multiple errors in response #47

Open trvrnrth opened 10 months ago

trvrnrth commented 10 months ago

Goal

Include lists of errors as returned from some API endpoints (eg. configure an integration) in raised Bugsnag::Api::Error messages.

Design

Added secondary check for errors in order to maintain existing error message for possible compatibility reasons.

Changeset

Testing

Manually tested with:

Bugsnag::Api::Client.new
Bugsnag::Api.get("projects/test/configured_integrations")

which raises:

Bugsnag::Api::Unauthorized:
  GET https://api.bugsnag.com/projects/test/configured_integrations: 401 - Errors: ["Authentication Required"]