src/helper.js
function formatResponseError(resp) {
    let result;

    if (resp.data.error) {
        result = resp.data.error.detail || resp.data.error;
    }
    else {
        result = resp.data.detail || JSON.stringify(resp.data);
    }

    return result.replace(/\n/g, '');
}
function formatResponseError(resp) {
    let result;

    if (resp.data.error) {
        result = resp.data.error.detail || resp.data.error;
    }
    else {
        result = resp.data.detail || JSON.stringify(resp.data);
    }

    return result.replace(/\n/g, '');
}
function formatResponseError ( resp ) { let result ; if ( resp . data . error ) { result = resp . data . error . detail || resp . data . error ; } else { result = resp . data . detail || JSON . stringify ( resp . data ) ; } return result . replace ( / \n / g , '' ) ; }
Find and format error in response object

@param {object} resp HTTP response
@returns {string} Error message
Find and format error in response object