阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js Error 异常

      Node.js Error 异常

      Node.js 应用程序一般会遇到以下四类错误:

      • 标准的 JavaScript 错误,例如 < EvalError>、< SyntaxError>、< RangeError>、< ReferenceError>、< TypeError> 或 < URIError>。
      • 由底层操作系触发的系统错误,例如试图打开不存在的文件、或试图使用已关闭的 socket 发送数据。
      • 由应用程序代码触发的用户自定义的错误。
      • AssertionError 错误,当 Node.js 检测到不应该发生的异常逻辑时触发。这类错误通常来自 assert 模块。

      所有由 Node.js 引起的 JavaScript 错误与系统错误都继承自或实例化自标准的 JavaScript < Error> 类,且保证至少提供类中的属性。

      • 错误的冒泡和捕获
      • Error 类
      • AssertionError 类
      • RangeError 类
      • ReferenceError 类
      • SyntaxError 类
      • TypeError 类
      • 异常与错误
      • 系统错误
      • Node.js 错误码
        • ERR_AMBIGUOUS_ARGUMENT
        • ERR_ARG_NOT_ITERABLE
        • ERR_ASSERTION
        • ERR_ASYNC_CALLBACK
        • ERR_ASYNC_TYPE
        • ERR_BUFFER_OUT_OF_BOUNDS
        • ERR_BUFFER_TOO_LARGE
        • ERR_CANNOT_TRANSFER_OBJECT
        • ERR_CANNOT_WATCH_SIGINT
        • ERR_CHILD_CLOSED_BEFORE_REPLY
        • ERR_CHILD_PROCESS_IPC_REQUIRED
        • ERR_CHILD_PROCESS_STDIO_MAXBUFFER
        • ERR_CLOSED_MESSAGE_PORT
        • ERR_CONSOLE_WRITABLE_STREAM
        • ERR_CONSTRUCT_CALL_REQUIRED
        • ERR_CPU_USAGE
        • ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED
        • ERR_CRYPTO_ECDH_INVALID_FORMAT
        • ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY
        • ERR_CRYPTO_ENGINE_UNKNOWN
        • ERR_CRYPTO_FIPS_FORCED
        • ERR_CRYPTO_FIPS_UNAVAILABLE
        • ERR_CRYPTO_HASH_DIGEST_NO_UTF16
        • ERR_CRYPTO_HASH_FINALIZED
        • ERR_CRYPTO_HASH_UPDATE_FAILED
        • ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS
        • ERR_CRYPTO_INVALID_DIGEST
        • ERR_CRYPTO_INVALID_STATE
        • ERR_CRYPTO_PBKDF2_ERROR
        • ERR_CRYPTO_SCRYPT_INVALID_PARAMETER
        • ERR_CRYPTO_SCRYPT_NOT_SUPPORTED
        • ERR_CRYPTO_SIGN_KEY_REQUIRED
        • ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH
        • ERR_DNS_SET_SERVERS_FAILED
        • ERR_DOMAIN_CALLBACK_NOT_AVAILABLE
        • ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE
        • ERR_ENCODING_INVALID_ENCODED_DATA
        • ERR_ENCODING_NOT_SUPPORTED
        • ERR_FALSY_VALUE_REJECTION
        • ERR_FS_FILE_TOO_LARGE
        • ERR_FS_INVALID_SYMLINK_TYPE
        • ERR_HTTP_HEADERS_SENT
        • ERR_HTTP_INVALID_HEADER_VALUE
        • ERR_HTTP_INVALID_STATUS_CODE
        • ERR_HTTP_TRAILER_INVALID
        • ERR_HTTP2_ALTSVC_INVALID_ORIGIN
        • ERR_HTTP2_ALTSVC_LENGTH
        • ERR_HTTP2_CONNECT_AUTHORITY
        • ERR_HTTP2_CONNECT_PATH
        • ERR_HTTP2_CONNECT_SCHEME
        • ERR_HTTP2_ERROR
        • ERR_HTTP2_GOAWAY_SESSION
        • ERR_HTTP2_HEADERS_AFTER_RESPOND
        • ERR_HTTP2_HEADERS_SENT
        • ERR_HTTP2_HEADER_SINGLE_VALUE
        • ERR_HTTP2_INFO_STATUS_NOT_ALLOWED
        • ERR_HTTP2_INVALID_CONNECTION_HEADERS
        • ERR_HTTP2_INVALID_HEADER_VALUE
        • ERR_HTTP2_INVALID_INFO_STATUS
        • ERR_HTTP2_INVALID_ORIGIN
        • ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH
        • ERR_HTTP2_INVALID_PSEUDOHEADER
        • ERR_HTTP2_INVALID_SESSION
        • ERR_HTTP2_INVALID_SETTING_VALUE
        • ERR_HTTP2_INVALID_STREAM
        • ERR_HTTP2_MAX_PENDING_SETTINGS_ACK
        • ERR_HTTP2_NESTED_PUSH
        • ERR_HTTP2_NO_SOCKET_MANIPULATION
        • ERR_HTTP2_ORIGIN_LENGTH
        • ERR_HTTP2_OUT_OF_STREAMS
        • ERR_HTTP2_PAYLOAD_FORBIDDEN
        • ERR_HTTP2_PING_CANCEL
        • ERR_HTTP2_PING_LENGTH
        • ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED
        • ERR_HTTP2_PUSH_DISABLED
        • ERR_HTTP2_SEND_FILE
        • ERR_HTTP2_SEND_FILE_NOSEEK
        • ERR_HTTP2_SESSION_ERROR
        • ERR_HTTP2_SETTINGS_CANCEL
        • ERR_HTTP2_SOCKET_BOUND
        • ERR_HTTP2_SOCKET_UNBOUND
        • ERR_HTTP2_STATUS_101
        • ERR_HTTP2_STATUS_INVALID
        • ERR_HTTP2_STREAM_CANCEL
        • ERR_HTTP2_STREAM_ERROR
        • ERR_HTTP2_STREAM_SELF_DEPENDENCY
        • ERR_HTTP2_TRAILERS_ALREADY_SENT
        • ERR_HTTP2_TRAILERS_NOT_READY
        • ERR_HTTP2_UNSUPPORTED_PROTOCOL
        • ERR_INDEX_OUT_OF_RANGE
        • ERR_INSPECTOR_ALREADY_CONNECTED
        • ERR_INSPECTOR_CLOSED
        • ERR_INSPECTOR_NOT_AVAILABLE
        • ERR_INSPECTOR_NOT_CONNECTED
        • ERR_INVALID_ADDRESS_FAMILY
        • ERR_INVALID_ARG_TYPE
        • ERR_INVALID_ARG_VALUE
        • ERR_INVALID_ARRAY_LENGTH
        • ERR_INVALID_ASYNC_ID
        • ERR_INVALID_BUFFER_SIZE
        • ERR_INVALID_CALLBACK
        • ERR_INVALID_CHAR
        • ERR_INVALID_CURSOR_POS
        • ERR_INVALID_DOMAIN_NAME
        • ERR_INVALID_FD
        • ERR_INVALID_FD_TYPE
        • ERR_INVALID_FILE_URL_HOST
        • ERR_INVALID_FILE_URL_PATH
        • ERR_INVALID_HANDLE_TYPE
        • ERR_INVALID_HTTP_TOKEN
        • ERR_INVALID_IP_ADDRESS
        • ERR_INVALID_OPT_VALUE
        • ERR_INVALID_OPT_VALUE_ENCODING
        • ERR_INVALID_PERFORMANCE_MARK
        • ERR_INVALID_PROTOCOL
        • ERR_INVALID_REPL_EVAL_CONFIG
        • ERR_INVALID_RETURN_PROPERTY
        • ERR_INVALID_RETURN_PROPERTY_VALUE
        • ERR_INVALID_RETURN_VALUE
        • ERR_INVALID_SYNC_FORK_INPUT
        • ERR_INVALID_THIS
        • ERR_INVALID_TRANSFER_OBJECT
        • ERR_INVALID_TUPLE
        • ERR_INVALID_URI
        • ERR_INVALID_URL
        • ERR_INVALID_URL_SCHEME
        • ERR_IPC_CHANNEL_CLOSED
        • ERR_IPC_DISCONNECTED
        • ERR_IPC_ONE_PIPE
        • ERR_IPC_SYNC_FORK
        • ERR_MEMORY_ALLOCATION_FAILED
        • ERR_METHOD_NOT_IMPLEMENTED
        • ERR_MISSING_ARGS
        • ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK
        • ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST
        • ERR_MISSING_MODULE
        • ERR_MISSING_PLATFORM_FOR_WORKER
        • ERR_MODULE_RESOLUTION_LEGACY
        • ERR_MULTIPLE_CALLBACK
        • ERR_NAPI_CONS_FUNCTION
        • ERR_NAPI_INVALID_DATAVIEW_ARGS
        • ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT
        • ERR_NAPI_INVALID_TYPEDARRAY_LENGTH
        • ERR_NAPI_TSFN_CALL_JS
        • ERR_NAPI_TSFN_GET_UNDEFINED
        • ERR_NAPI_TSFN_START_IDLE_LOOP
        • ERR_NAPI_TSFN_STOP_IDLE_LOOP
        • ERR_NO_CRYPTO
        • ERR_NO_ICU
        • ERR_NO_LONGER_SUPPORTED
        • ERR_OUT_OF_RANGE
        • ERR_REQUIRE_ESM
        • ERR_SCRIPT_EXECUTION_INTERRUPTED
        • ERR_SERVER_ALREADY_LISTEN
        • ERR_SERVER_NOT_RUNNING
        • ERR_SOCKET_ALREADY_BOUND
        • ERR_SOCKET_BAD_BUFFER_SIZE
        • ERR_SOCKET_BAD_PORT
        • ERR_SOCKET_BAD_TYPE
        • ERR_SOCKET_BUFFER_SIZE
        • ERR_SOCKET_CANNOT_SEND
        • ERR_SOCKET_CLOSED
        • ERR_SOCKET_DGRAM_NOT_RUNNING
        • ERR_STREAM_CANNOT_PIPE
        • ERR_STREAM_DESTROYED
        • ERR_STREAM_NULL_VALUES
        • ERR_STREAM_PREMATURE_CLOSE
        • ERR_STREAM_PUSH_AFTER_EOF
        • ERR_STREAM_UNSHIFT_AFTER_END_EVENT
        • ERR_STREAM_WRAP
        • ERR_STREAM_WRITE_AFTER_END
        • ERR_STRING_TOO_LONG
        • ERR_SYSTEM_ERROR
        • ERR_TLS_CERT_ALTNAME_INVALID
        • ERR_TLS_DH_PARAM_SIZE
        • ERR_TLS_HANDSHAKE_TIMEOUT
        • ERR_TLS_RENEGOTIATE
        • ERR_TLS_RENEGOTIATION_DISABLED
        • ERR_TLS_REQUIRED_SERVER_NAME
        • ERR_TLS_SESSION_ATTACK
        • ERR_TLS_SNI_FROM_SERVER
        • ERR_TRACE_EVENTS_CATEGORY_REQUIRED
        • ERR_TRACE_EVENTS_UNAVAILABLE
        • ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER
        • ERR_TRANSFORM_ALREADY_TRANSFORMING
        • ERR_TRANSFORM_WITH_LENGTH_0
        • ERR_TTY_INIT_FAILED
        • ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET
        • ERR_UNESCAPED_CHARACTERS
        • ERR_UNHANDLED_ERROR
        • ERR_UNKNOWN_BUILTIN_MODULE
        • ERR_UNKNOWN_ENCODING
        • ERR_UNKNOWN_FILE_EXTENSION
        • ERR_UNKNOWN_MODULE_FORMAT
        • ERR_UNKNOWN_SIGNAL
        • ERR_UNKNOWN_STDIN_TYPE
        • ERR_UNKNOWN_STREAM_TYPE
        • ERR_V8BREAKITERATOR
        • ERR_VALID_PERFORMANCE_ENTRY_TYPE
        • ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING
        • ERR_VM_MODULE_ALREADY_LINKED
        • ERR_VM_MODULE_DIFFERENT_CONTEXT
        • ERR_VM_MODULE_LINKING_ERRORED
        • ERR_VM_MODULE_NOT_LINKED
        • ERR_VM_MODULE_NOT_MODULE
        • ERR_VM_MODULE_STATUS
        • ERR_WORKER_PATH
        • ERR_WORKER_UNSERIALIZABLE_ERROR
        • ERR_WORKER_UNSUPPORTED_EXTENSION
        • ERR_ZLIB_INITIALIZATION_FAILED
        • HPE_HEADER_OVERFLOW
        • MODULE_NOT_FOUND
      • 废弃的 Node.js 错误码
        • ERR_HTTP2_FRAME_ERROR
        • ERR_HTTP2_HEADERS_OBJECT
        • ERR_HTTP2_HEADER_REQUIRED
        • ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND
        • ERR_HTTP2_STREAM_CLOSED
        • ERR_HTTP_INVALID_CHAR
        • ERR_NAPI_CONS_PROTOTYPE_OBJECT
        • ERR_OUTOFMEMORY
        • ERR_PARSE_HISTORY_DATA
        • ERR_STDERR_CLOSE
        • ERR_STDOUT_CLOSE
        • ERR_STREAM_READ_NOT_IMPLEMENTED
        • ERR_TLS_RENEGOTIATION_FAILED
        • ERR_UNKNOWN_BUILTIN_MODULE
        • ERR_VALUE_OUT_OF_RANGE
        • ERR_ZLIB_BINDING_CLOSED
        • 其他错误码
          • ERR_FS_WATCHER_ALREADY_STARTED
          • ERR_FS_WATCHER_NOT_STARTED
          • ERR_HTTP2_ALREADY_SHUTDOWN
          • ERR_HTTP2_ERROR
          • ERR_INVALID_REPL_HISTORY
          • ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK
          • ERR_STREAM_HAS_STRINGDECODER
          • ERR_STRING_TOO_LARGE
      目录
      本文目录
      目录