lbry-desktop/ui/util/handle-fetch.js

4 lines
176 B
JavaScript
Raw Normal View History

2018-03-26 23:32:43 +02:00
export default function handleFetchResponse(response) {
2019-05-07 23:38:29 +02:00
return response.status === 200 ? Promise.resolve(response.json()) : Promise.reject(new Error(response.statusText));
2018-03-26 23:32:43 +02:00
}