Seeking Improved Method for Data Type Narrowing

Is there a better way to do this? I want to take both the status code of the response, and the json body into account when generating my errors.

Ideally I could use Http.client.filterStatusOk, but catch the error and have access to the response when producing my custom error
Was this page helpful?