dist/lib/utils.js
function createError(code, details) {
    var error = {
        code: code,
        message: errors.get(code) || "Internal Server Error"
    };

    if (details) error["data"] = details;

    return error;
}
function createError(code, details) {
    var error = {
        code: code,
        message: errors.get(code) || "Internal Server Error"
    };

    if (details) error["data"] = details;

    return error;
}
function createError ( code , details ) { var error = { code : code , message : errors . get ( code ) || "Internal Server Error" } ; if ( details ) error [ "data" ] = details ; return error ; }
Creates a JSON-RPC 2.0-compliant error.
@param {Number} code - error code
@param {String} details - error details
@return {Object}
Creates a JSON - RPC 2 . 0 - compliant error .