How to use the errno.strerror function in errno

To help you get started, we’ve selected a few errno 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 saghul / sjs / modules / process.js View on Github external
os._exit(127);
    } else {
        // parent
        //

        // wait until child has started
        os.close(errorPipe[1]);
        var r = os.read(errorPipe[0]);
        if (r.length === 0) {
            // child started succesfully
            r = 0;
        } else {
            var p = os.waitpid(pid, 0);
            assert.equal(p.pid, pid);
            var errorno = Number.parseInt(new TextDecoder().decode(r));
            r = new Error('Faild to spawn child: [errno ' + errorno + '] ' + errno.strerror(errorno));
            r.errno = errorno;
        }

        // close fds
        var fds = [devNull, errorPipe[0], stdinPipe[0], stdoutPipe[1], stderrPipe[1]];
        fds.forEach(function(fd) {
            if (fd > os.STDERR_FILENO) {
                silentClose(fd);
            }
        });

        // throw error, if there was one
        if (r instanceof Error) {
            throw r;
        }
github saghul / sjs / modules / fs.js View on Github external
function checkFile() {
    if (this._f === null) {
        const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
        e.errno = errno.EBADF;
        throw e;
    }
}
github saghul / sjs / modules / io.js View on Github external
function checkFile() {
    if (this._f === null) {
        const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
        e.errno = errno.EBADF;
        throw e;
    }
}
github saghul / sjs / modules / net.js View on Github external
function checkSocket() {
    if (this._fd === -1) {
        const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
        e.errno = errno.EBADF;
        throw e;
    }
}

errno

libuv errno details exposed

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis