raise if there is an error in the response from fetch.