UNPKG

@jbrowse/plugin-authentication

Version:

JBrowse 2 Authentication

18 lines (17 loc) 449 B
export async function getResponseError({ response, reason, statusText, }) { return [ `HTTP ${response.status}`, reason, statusText !== null && statusText !== void 0 ? statusText : (await getError(response)), ] .filter(f => !!f) .join(' - '); } export async function getError(response) { try { return await response.text(); } catch (e) { return response.statusText; } }