diff --git a/src/lib/request.js b/src/lib/request.js index 8e02f16..c43a40d 100644 --- a/src/lib/request.js +++ b/src/lib/request.js @@ -88,6 +88,13 @@ export default function (relativeUrl, opts, callback) { return fetch(url, config) .then((response) => { + if ( + opts?.requestOptions?.is404Error === true && + response.status === 404 + ) { + throw new Error('404'); + } + if (response.headers.get('content-type').indexOf('application/json') !== -1) { return response.json(); }