Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(data => {
const status = data.response.status;
if (status < 200 || status >= 300) {
return promises
.expand(data.body, {
base: getDocumentationUrlFromHeaders(data.response.headers),
})
.then(json => {
return Promise.reject(
new HttpError(
json[0]['http://www.w3.org/ns/hydra/core#description'][0][
'@value'
],
status,
),
);
})
.catch(e => {
if (e.hasOwnProperty('body')) {
return Promise.reject(e);
}