src/plugin/iframe_root/modules/api/restClient.js
/**
         * Invisibly deals with errors from Fetch. Fetch is nice, but annoying in
         * that the 400-level errors don't raise errors on their own. This wraps
         * the call and deals with that before returning the response to whatever
         * called this API.
         * @param {object} response - a response from the Fetch API.
         */
Invisibly deals with errors from Fetch. Fetch is nice, but annoying in
that the 400-level errors don't raise errors on their own. This wraps
the call and deals with that before returning the response to whatever
called this API.
@param {object} response - a response from the Fetch API.
Invisibly deals with errors from Fetch . Fetch is nice but annoying in that the 400 - level errors don ' t raise errors on their own . This wraps the call and deals with that before returning the response to whatever called this API . @param { object } response - a response from the Fetch API .
handleErrors(response) {
            if (!response.ok) {
                console.error(response);
                throw Error(response.statusText);
            }
            return response;
        }
handleErrors ( response ) { if ( ! response . ok ) { console . error ( response ) ; throw Error ( response . statusText ) ; } return response ; }
Invisibly deals with errors from Fetch.
Invisibly deals with errors from Fetch .