crest/middleware/throwOnUnsuccessful

Throws an error when given an unsuccessful response.
Source:
Parameters:
Name Type Description
promise Promise.<Response> Promise from previous middleware.
Throws:
Thrown when the response status was not in the 2xx range.
Type
CRESTError
Returns:
Promise to pass to next middleware.
Type
Promise