lib/response/error.js
function defaultTransformError(err,req){
    let body = {
        code: err.code,
        message: err.message,
        data: err.data,
    }

    if (req._expressDeliverOptions.printErrorStack===true){
        body.stack = err.stack
    }

    if (err.name == 'InternalError' && req._expressDeliverOptions.printInternalErrorData!==true){
        delete body.data
    }

    return {
        status:false,
        error:body
    }
}
function defaultTransformError(err,req){
    let body = {
        code: err.code,
        message: err.message,
        data: err.data,
    }

    if (req._expressDeliverOptions.printErrorStack===true){
        body.stack = err.stack
    }

    if (err.name == 'InternalError' && req._expressDeliverOptions.printInternalErrorData!==true){
        delete body.data
    }

    return {
        status:false,
        error:body
    }
}
function defaultTransformError ( err , req ) { let body = { code : err . code , message : err . message , data : err . data , } if ( req . _expressDeliverOptions . printErrorStack === true ) { body . stack = err . stack } if ( err . name == 'InternalError' && req . _expressDeliverOptions . printInternalErrorData !== true ) { delete body . data } return { status : false , error : body } }
Default error response transformation
@param  {Exception} err
@param  {Request} req
@return {Object}
Default error response transformation