lbry-desktop/ui/util/handle-fetch.js
2019-11-11 13:27:29 -05:00

3 lines
176 B
JavaScript

export default function handleFetchResponse(response) {
return response.status === 200 ? Promise.resolve(response.json()) : Promise.reject(new Error(response.statusText));
}