Attempt to turn an HTTP error response into a Javascript Error.
If it is a JSON response, we will parse it into a MatrixError. Otherwise we return a generic Error.
response object
Optional
raw body of the response
Attempt to turn an HTTP error response into a Javascript Error.
If it is a JSON response, we will parse it into a MatrixError. Otherwise we return a generic Error.