How to use the infusion.fail function in infusion

To help you get started, we’ve selected a few infusion examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GPII / universal / gpii / node_modules / flowManager / src / Snapshot.js View on Github external
fs.readFile(fullPath, 'utf8', function (err, solutions) {
            if (err) {
                fluid.fail("FUCK OFF");
            }
            solutions = JSON.parse(solutions);
            solutions = matchMaker.prefilterSolutions(solutions, device);
            event.fire(solutions, rptmp);
        });
//         var fs = require('fs');
github GPII / universal / gpii / node_modules / journal / src / SettingsDir.js View on Github external
gpii.settingsDir.createGpii = function (that) {
    fluid.log(fluid.logLevel.WARN, "Creating GPII settings directory in ", that.gpiiSettingsDir);
    try { // See code skeleton in http://stackoverflow.com/questions/13696148/node-js-create-folder-or-use-existing
        fs.mkdirSync(that.gpiiSettingsDir);
    } catch (e) {
        if (e.code !== "EEXIST") {
            fluid.fail("Unable to create GPII settings directory, code is " + e.code + ": exception ", e);
        }
    }
};
github GPII / universal / gpii / node_modules / userListeners / src / pcsc.js View on Github external
gpii.userListeners.pcsc.detectCard = function (atr) {
    if (!atr instanceof Buffer) {
        fluid.fail("atr needs to be a Buffer.");
    }

    var knownCards = gpii.userListeners.pcsc.knownCards;

    var card = fluid.find(knownCards, function (card) {
        return fluid.find(card.atrs, function (atrTest) {
            return atrTest.equals(atr) ? card : undefined;
        });
    });

    return card || null;
};
github GPII / universal / gpii / node_modules / flowManager / src / UserLogin.js View on Github external
promise.then(function (deviceData) {
            if (deviceData.isError) {
                fluid.fail("Error in device reporter data", deviceData.message);
            }
            event.fire(deviceData);
        }, function (err) {
            fluid.fail("Rejected device reporter promise: " + err.message);
github GPII / universal / gpii / node_modules / flowManager / src / SolutionsRegistryDataSource.js View on Github external
gpii.flowManager.solutionsRegistry.dataSource.loadSolutionsRegistry = function (that) {
    if (!that.options.path) {
        fluid.fail("The solutionsRegistry datasource ", that, " needs a \"path\" option pointing to the solution entries folder");
    }
    var url = fluid.module.resolvePath(that.options.path);
    if (!fs.existsSync(url)) {
        fluid.fail("The path provided to the solutionsRegistry datasource (", url, ") has not been found on the file system");
    }

    that.fullSolutionsRegistry = fluid.freezeRecursive(require(url));
};
github GPII / universal / gpii / node_modules / flowManager / src / SolutionsRegistryDataSource.js View on Github external
gpii.flowManager.solutionsRegistry.dataSource.loadSolutionsRegistry = function (that) {
    if (!that.options.path) {
        fluid.fail("The solutionsRegistry datasource ", that, " needs a \"path\" option pointing to the solution entries folder");
    }
    var url = fluid.module.resolvePath(that.options.path);
    if (!fs.existsSync(url)) {
        fluid.fail("The path provided to the solutionsRegistry datasource (", url, ") has not been found on the file system");
    }

    that.fullSolutionsRegistry = fluid.freezeRecursive(require(url));
};
github GPII / universal / gpii / node_modules / settingsHandlers / src / ExplodingSettingsHandler.js View on Github external
gpii.settingsHandlers.exploding.explode = function (operation, explodeSettings) {
    var errorMessage = "Exploding settings handler has failed on " + operation + " method";
    var errorPayload = explodeSettings.errorPayload || {
        isError: true,
        message: errorMessage
    };
    if (explodeSettings.explodeMethod === "reject") {
        return fluid.promise().reject(errorPayload);
    } else if (explodeSettings.explodeMethod === "fail") {
        fluid.fail(errorMessage);
    } else if (explodeSettings.explodeMethod === "throw") {
        throw new Error(errorMessage);
    }
};
github GPII / universal / gpii / node_modules / flowManager / src / UserLogin.js View on Github external
}, function (err) {
            fluid.fail("Rejected device reporter promise: " + err.message);
        });
    };
github GPII / universal / gpii / node_modules / settingsHandlers / src / RemoteFileSettingsHandler.js View on Github external
settingPromise.then(null, function (reason) {
                fluid.fail("remoteFileSettingsHandler failed for setting '" + key + "' in payload ", payload, reason);
            });
github GPII / universal / gpii / node_modules / journal / src / Journal.js View on Github external
gpii.journal.restoreJournal = function (journalThat, lifecycleManager, journalId) {
    var parsed = gpii.journal.parseId(journalId);
    if (parsed.isError) {
        fluid.fail(parsed.message);
    } else {
        fluid.log("Restoring journal with id " + journalId);
        var journal = gpii.journal.fetchJournal(journalThat.journalFiles, parsed);
        if (!journal) {
            return fluid.promise().reject({
                isError: true,
                message: "journal Id " + journalId + " could not be looked up to a journal"
            });
        } else {
            fluid.log("Restoring journal snapshot with contents " + JSON.stringify(journal, null, 2));
            return lifecycleManager.restoreSnapshot(journal.originalSettings);
        }
    }
};