src/network/error-parsing.js
function _treatBadRequestExceptions(responseJSON = {}, options) {
    responseJSON.type = responseJSON.type || errorTypes.entity;
    if (responseJSON.type !== undefined) {
        switch (responseJSON.type) {
            case errorTypes.entity:
                return _treatEntityExceptions(responseJSON, options);
            case errorTypes.collection:
                return _treatCollectionExceptions(responseJSON, options);
            default:
                break;
        }
    }
    return null;
}
function _treatBadRequestExceptions(responseJSON = {}, options) {
    responseJSON.type = responseJSON.type || errorTypes.entity;
    if (responseJSON.type !== undefined) {
        switch (responseJSON.type) {
            case errorTypes.entity:
                return _treatEntityExceptions(responseJSON, options);
            case errorTypes.collection:
                return _treatCollectionExceptions(responseJSON, options);
            default:
                break;
        }
    }
    return null;
}
function _treatBadRequestExceptions ( responseJSON = { } , options ) { responseJSON . type = responseJSON . type || errorTypes . entity ; if ( responseJSON . type !== undefined ) { switch ( responseJSON . type ) { case errorTypes . entity : return _treatEntityExceptions ( responseJSON , options ) ; case errorTypes . collection : return _treatCollectionExceptions ( responseJSON , options ) ; default : break ; } } return null ; }
Treat with all the custom exception
@param  {object} responseJSON - Response from the server.
@param  {object} options      - Options for the exceptions teratement such as the {model: modelVar}.
@return {object}              - The parsed error response.
Treat with all the custom exception