lib/response/error.js
function normalizeError(err,pools){
    if (!(err instanceof Error)){
        err = new Error(err)
    }
    if (!err._isException){

        //Iterate over exceptionPools finding error match
        for(let i=0;i<pools.length;i++){
            let exception = pools[i]._convert(err)
            if (exception) return exception
        }
    }
    return err
}
function normalizeError(err,pools){
    if (!(err instanceof Error)){
        err = new Error(err)
    }
    if (!err._isException){

        //Iterate over exceptionPools finding error match
        for(let i=0;i<pools.length;i++){
            let exception = pools[i]._convert(err)
            if (exception) return exception
        }
    }
    return err
}
function normalizeError ( err , pools ) { if ( ! ( err instanceof Error ) ) { err = new Error ( err ) } if ( ! err . _isException ) { //Iterate over exceptionPools finding error match for ( let i = 0 ; i < pools . length ; i ++ ) { let exception = pools [ i ] . _convert ( err ) if ( exception ) return exception } } return err }
Tries to always return an expressDeliver exception
@param  {any} err
@param  {Array<ExceptionPool>} pools
@return {Exception}
Tries to always return an expressDeliver exception