bugsnag-api-ruby icon indicating copy to clipboard operation
bugsnag-api-ruby copied to clipboard

Handle multiple errors in response

Open trvrnrth opened this issue 2 years ago • 0 comments

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

  • Added secondary check for errors
  • Tidied up whitespace, unused variables and docs

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"]

trvrnrth avatar Nov 03 '23 17:11 trvrnrth