How to use the errno.EBADF 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 / 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;
    }
}
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;
    }
}

errno

libuv errno details exposed

MIT
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis