0.0.1 • Published 5 years ago

nix-errno-codes v0.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

nix-errno-codes

Constants enumerating POSIX/Linux errno.h error codes.

Completely library agnostic. TypeScript-compatible. No dependencies.

Installation

npm install errno-codes --save

Usage

import {
  readdirSync,
} from 'fs';

import {
  CODES,
  getDescription,
} from './index';

try {
  readdirSync('./non-existent-file.txt');
} catch(error) {
  if (error.code === CODES.ENOENT) {
    console.error(getDescription(CODES.ENOENT)); // No such file or directory
  }
}

Codes

CodeDescription
E2BIGArgument list too long
ECCESPermission denied
EADDRINUSEAddress already in use
EADDRNOTAVAILAddress not available
EAFNOSUPPORTAddress family not supported
EAGAINResource temporarily unavailable
EALREADYConnection already in progress
EBADEInvalid exchange
EBADFBad file descriptor
EBADFDFile descriptor in bad state
EBADMSGBad message
EBADRInvalid request descriptor
EBADRQCInvalid request code
EBADSLTInvalid slot
EBUSYDevice or resource busy
ECANCELEDOperation canceled
ECHILDNo child processes
ECHRNGChannel number out of range
ECOMMCommunication error on send
ECONNABORTEDConnection aborted
ECONNREFUSEDConnection refused
ECONNRESETConnection reset
EDEADLKResource deadlock avoided
EDEADLOCKResource deadlock avoided or File locking deadlock error
EDESTADDRREQDestination address required
EDOMMathematics argument out of domain of function
EDQUOTDisk quota exceeded
EEXISTFile exists
EFAULTBad address
EFBIGFile too large
EHOSTDOWNHost is down
EHOSTUNREACHHost is unreachable
EHWPOISONMemory page has hardware error
EIDRMIdentifier removed
EILSEQInvalid or incomplete multibyte or wide character
EINPROGRESSOperation in progress
EINTRInterrupted function call
EINVALInvalid argument
EIOInput/output error
EISCONNSocket is connected
EISDIRIs a directory
EISNAMIs a named type file
EKEYEXPIREDKey has expired
EKEYREJECTEDKey was rejected by service
EKEYREVOKEDKey has been revoked
EL2HLTLevel 2 halted
EL2NSYNCLevel 2 not synchronized
EL3HLTLevel 3 halted
EL3RSTLevel 3 reset
ELIBACCCannot access a needed shared library
ELIBBADAccessing a corrupted shared library
ELIBMAXAttempting to link in too many shared libraries
ELIBSCN.lib section in a.out corrupted
ELIBEXECCannot exec a shared library directly
ELNRANGELink number out of range
ELOOPToo many levels of symbolic links
EMEDIUMTYPEWrong medium type
EMFILEToo many open files
EMLINKToo many links
EMSGSIZEMessage too long
EMULTIHOPMultihop attempted
ENAMETOOLONGFilename too long
ENETDOWNNetwork is down
ENETRESETConnection aborted by network
ENETUNREACHNetwork unreachable
ENFILEToo many open files in system
ENOANONo anode
ENOBUFSNo buffer space available
ENODATANo message is available on the STREAM head read queue
ENODEVNo such device
ENOENTNo such file or directory
ENOEXECExec format error
ENOKEYRequired key not available
ENOLCKNo locks available
ENOLINKLink has been severed
ENOMEDIUMNo medium found
ENOMEMNot enough space/cannot allocate memory
ENOMSGNo message of the desired type
ENONETMachine is not on the network
ENOPKGPackage not installed
ENOPROTOOPTProtocol not available
ENOSPCNo space left on device
ENOSRNo STREAM resources
ENOSTRNot a STREAM
ENOSYSFunction not implemented
ENOTBLKBlock device required
ENOTCONNThe socket is not connected
ENOTDIRNot a directory
ENOTEMPTYDirectory not empty
ENOTRECOVERABLEState not recoverable
ENOTSOCKNot a socket
ENOTSUPOperation not supported
ENOTTYInappropriate I/O control operation
ENOTUNIQName not unique on network
ENXIONo such device or address
EOPNOTSUPPOperation not supported on socket
EOVERFLOWValue too large to be stored in data type
EOWNERDEADOwner died
EPERMOperation not permitted
EPFNOSUPPORTProtocol family not supported
EPIPEBroken pipe
EPROTOProtocol error
EPROTONOSUPPORTProtocol not supported
EPROTOTYPEProtocol wrong type for socket
ERANGEResult too large
EREMCHGRemote address changed
EREMOTEObject is remote
EREMOTEIORemote I/O error
ERESTARTInterrupted system call should be restarted
ERFKILLOperation not possible due to RF-kill
EROFSRead-only filesystem
ESHUTDOWNCannot send after transport endpoint shutdown
ESPIPEInvalid seek
ESOCKTNOSUPPORTSocket type not supported
ESRCHNo such process
ESTALEStale file handle
ESTRPIPEStreams pipe error
ETIMETimer expired
ETIMEDOUTConnection timed out
ETOOMANYREFSToo many references: cannot splice
ETXTBSYText file busy
EUCLEANStructure needs cleaning
EUNATCHProtocol driver not attached
EUSERSToo many users
EWOULDBLOCKOperation would block
EXDEVImproper link
EXFULLExchange full