How to use the hoek.ignore function in hoek

To help you get started, we’ve selected a few hoek 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 c3duan / Swag-Bot / node_modules / sntp / lib / index.js View on Github external
if (err ||
            bytes !== 48) {

            return team.attend(err || new Boom('Could not send entire message'));
        }
    });

    try {
        return await team.work;
    }
    finally {
        clearTimeout(timeoutId);

        socket.removeAllListeners();
        socket.once('error', Hoek.ignore);

        try {
            socket.close();
        }
        catch (ignoreErr) { }       // Ignore errors if the socket is already closed
    }
};
github ozum / joi18n / node_modules / hapi / node_modules / subtext / lib / index.js View on Github external
}

            resolve(result);
        };

        file.once('close', finalize);
        file.once('error', finalize);

        const onAbort = () => finalize(Boom.badRequest('Client connection aborted'));
        req.once('aborted', onAbort);

        internals.pipe(stream, counter);
        internals.pipe(counter, file);
    });

    promise.catch(Hoek.ignore);     // Prevent triggering node's PromiseRejectionHandledWarning
    return promise;
};
github outmoded / metaphor / lib / twitter.js View on Github external
Wreck.request('HEAD', url, {}, (err, res) => {

        if (err ||
            res.statusCode >= 400) {

            return callback({});
        }

        Wreck.read(res, null, Hoek.ignore);        // Flush out any payload
        return callback(res.headers);
    });
};
github hapijs / hapi / lib / pack.js View on Github external
internals.Pack.prototype.start = function (callback) {

    var self = this;

    callback = callback || Hoek.ignore;

    // Assert dependencies

    for (var i = 0, il = this._core._dependencies.length; i < il; ++i) {
        var dependency = this._core._dependencies[i];
        for (var s = 0, sl = dependency.connections.length; s < sl; ++s) {
            var server = dependency.connections[s];
            for (var d = 0, dl = dependency.deps.length; d < dl; ++d) {
                var dep = dependency.deps[d];
                Hoek.assert(server._registrations[dep], 'Plugin', dependency.plugin, 'missing dependency', dep, 'in server:', server.info.uri);
            }
        }
    }

    // Start cache
github sx1989827 / DOClever / Desktop / node_modules / sntp / lib / index.js View on Github external
const finish = Hoek.once((err, result) => {

        clearTimeout(timeoutId);

        socket.removeAllListeners();
        socket.once('error', Hoek.ignore);

        try {
            socket.close();
        }
        catch (ignoreErr) { }       // Ignore errors if the socket is already closed

        return callback(err, result);
    });
github hapijs / hapi / test / connection.js View on Github external
it('replies with a view', function (done) {

                var server = new Hapi.Server();
                server.register(Vision, Hoek.ignore);
                server.connection();

                server.views({
                    engines: { 'html': Handlebars },
                    path: __dirname + '/templates'
                });

                server.ext('onRequest', function (request, reply) {

                    return reply.view('test', { message: 'hola!' });
                });

                var handler = function (request, reply) {

                    return reply('ok');
                };
github hapijs / good / test / network.js View on Github external
server.start(function () {

            for (var i = 0; i < 10; ++i) {
                Http.get({
                    path: '/',
                    host: server.info.host,
                    port: server.info.port,
                    agent: httpAgent
                }, Hoek.ignore);

                Http.get({
                    path: '/foo',
                    host: server.info.host,
                    port: server.info.port,
                    agent: httpAgent
                }, Hoek.ignore);
            }


            setTimeout(function () {

                Items.parallel.execute({
                    requests: network.requests.bind(network),
                    concurrents: network.concurrents.bind(network),
                    response: network.responseTimes.bind(network),
                    sockets: network.sockets.bind(network, [httpAgent], [httpsAgent])
                }, function (err, results) {

                    var port = server.info.port;

                    expect(err).to.not.exist();
                    expect(results.requests[port]).to.exist();
github graalvm / graaljs / deps / npm / node_modules / request / node_modules / hawk / node_modules / sntp / lib / index.js View on Github external
const finish = Hoek.once((err, result) => {

        if (timeoutId) {
            clearTimeout(timeoutId);
            timeoutId = 0;
        }

        socket.removeAllListeners();
        socket.once('error', Hoek.ignore);
        socket.close();
        return callback(err, result);
    });
github outmoded / penseur / lib / db.js View on Github external
this.tables[table].changes = function (criteria, changesOptions) {

            if (typeof changesOptions !== 'object') {
                changesOptions = { handler: changesOptions };
            }

            const error = Table.error(Boom.internal('Simulated database error'), { table, action: method });
            error.flags = Hoek.applyToDefaults({ willReconnect: true, disconnected: true }, options.flags || {});
            process.nextTick(() => changesOptions.handler(error));
            return { close: Hoek.ignore };
        };
github hapijs / hapi / lib / composer.js View on Github external
internals.Composer.prototype.start = function (callback) {

    callback = callback || Hoek.ignore;

    Async.forEachSeries(this._packs, function (pack, next) {

        pack.start(next);
    },
    function (err) {

        Hoek.assert(!err, 'Failed starting plugins:', err && err.message);
        return callback();
    });
};