lbry-desktop/ui/util/handle-fetch.js
2020-07-27 16:37:36 -04:00

4 lines
209 B
JavaScript

// @flow
export default function handleFetchResponse(response: Response): Promise<any> {
return response.status === 200 ? Promise.resolve(response.json()) : Promise.reject(new Error(response.statusText));
}