src/network/error-parsing.js
function _treatGlobalErrors(responseJSON, options) {
    options = options || {};
    const allMessagesTypes = options.globalMessages || globalMessages;
    if (responseJSON !== undefined) {
        let globalMessagesContainer = [];
        let messages = responseJSON;
        //Looping through all messages types.
        allMessagesTypes.forEach((globalMessageConf) => {
            //Treat all the globals
            let msgs = messages[globalMessageConf.name];
            if (msgs) {
                globalMessagesContainer = [...globalMessagesContainer, ...msgs];
                //To remove
                _treatGlobalMessagesPerType(msgs, globalMessageConf.type);
            }
        });
        return globalMessagesContainer;
    }
    return null;
}
function _treatGlobalErrors(responseJSON, options) {
    options = options || {};
    const allMessagesTypes = options.globalMessages || globalMessages;
    if (responseJSON !== undefined) {
        let globalMessagesContainer = [];
        let messages = responseJSON;
        //Looping through all messages types.
        allMessagesTypes.forEach((globalMessageConf) => {
            //Treat all the globals
            let msgs = messages[globalMessageConf.name];
            if (msgs) {
                globalMessagesContainer = [...globalMessagesContainer, ...msgs];
                //To remove
                _treatGlobalMessagesPerType(msgs, globalMessageConf.type);
            }
        });
        return globalMessagesContainer;
    }
    return null;
}
function _treatGlobalErrors ( responseJSON , options ) { options = options || { } ; const allMessagesTypes = options . globalMessages || globalMessages ; if ( responseJSON !== undefined ) { let globalMessagesContainer = [ ] ; let messages = responseJSON ; //Looping through all messages types. allMessagesTypes . forEach ( ( globalMessageConf ) => { //Treat all the globals let msgs = messages [ globalMessageConf . name ] ; if ( msgs ) { globalMessagesContainer = [ ... globalMessagesContainer , ... msgs ] ; //To remove _treatGlobalMessagesPerType ( msgs , globalMessageConf . type ) ; } } ) ; return globalMessagesContainer ; } return null ; }
Treat the global errors.
@param  {object} responseJSON - Treat the global errors.
@param {object} options - Options for error handling.{isDisplay:[true/false], globalMessages: [{type: "error", name: "propertyName"}]}
@return {array} array of all treated message
Treat the global errors .