examples/console-client/index.js
function fail(context, err) {
    var message;
    switch (err.code) {
        case "ENOENT":
            message = err.path + ": No such file or directory";
            break;
        case "ENOSYS":
            message = "Command not supported";
            break;
        default:
            message = err["description"] || err.message;
            break;
    }
    
    return context.fail(message);
}
function fail(context, err) {
    var message;
    switch (err.code) {
        case "ENOENT":
            message = err.path + ": No such file or directory";
            break;
        case "ENOSYS":
            message = "Command not supported";
            break;
        default:
            message = err["description"] || err.message;
            break;
    }
    
    return context.fail(message);
}
function fail ( context , err ) { var message ; switch ( err . code ) { case "ENOENT" : message = err . path + ": No such file or directory" ; break ; case "ENOSYS" : message = "Command not supported" ; break ; default : message = err [ "description" ] || err . message ; break ; } return context . fail ( message ) ; }
fail command with an error message
fail command with an error message