New Aux API Request Errors

Some API requests require additional, sub-requests to be made by the Trello server. Each auxiliary API request performed behind-the-scenes of an actual API request has the potential to throw an error.

Previously, the sub-request would bubble its failure up to the top level and return a 4XX. This could make it hard to identify the underlying cause of the error.

With this change, when a subrequest errors, instead of passing that error up to the main request, Trello will throw a new SubrequestFailed error, attach some identifying information about the original error and what path it occurred on, and pass that SubrequestFailed error up to the main request. This error will have a status code of 449.

If your integration catches specific status codes, it should add a handler for the 449 status code. This new error can occur any place where a 4XX error was previously occurring.

For instance, previously we may have returned the following error when a subrequest failed:

HTTP 401
Body (text): unauthorized permission requested

And now we would return:

HTTP 449
Body (JSON): {
  path: 'boards',
  originalMessage: 'Unauthorized',
  originalStatus: 401