@jbrowse/plugin-authentication
Version:
JBrowse 2 Authentication
22 lines (21 loc) • 586 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResponseError = getResponseError;
exports.getError = getError;
async function getResponseError({ response, reason, statusText, }) {
return [
`HTTP ${response.status}`,
reason,
statusText !== null && statusText !== void 0 ? statusText : (await getError(response)),
]
.filter(f => !!f)
.join(' - ');
}
async function getError(response) {
try {
return await response.text();
}
catch (e) {
return response.statusText;
}
}