// used by generate-node-errors.ts
type ErrorCodeMapping = Array<
  [
    /** error.code  */
    code: string,
    /** Constructor **/
    ctor: typeof TypeError | typeof RangeError | typeof Error | typeof SyntaxError,
    /** error.name. Defaults to `Constructor.name` (that is, mapping[1].name  */
    name?: string,
    (typeof TypeError | typeof RangeError | typeof Error | typeof SyntaxError)?,
    (typeof TypeError | typeof RangeError | typeof Error | typeof SyntaxError)?,
  ]
>;

const errors: ErrorCodeMapping = [
  ["ABORT_ERR", Error, "AbortError"],
  ["ERR_ACCESS_DENIED", Error],
  ["ERR_AMBIGUOUS_ARGUMENT", TypeError],
  ["ERR_ARG_NOT_ITERABLE", TypeError],
  ["ERR_ASSERTION", Error],
  ["ERR_ASYNC_CALLBACK", TypeError],
  ["ERR_ASYNC_TYPE", TypeError],
  ["ERR_BODY_ALREADY_USED", Error],
  ["ERR_BORINGSSL", Error],
  ["ERR_ZSTD", Error],
  ["ERR_BROTLI_INVALID_PARAM", RangeError],
  ["ERR_BUFFER_CONTEXT_NOT_AVAILABLE", Error],
  ["ERR_BUFFER_OUT_OF_BOUNDS", RangeError],
  ["ERR_BUFFER_TOO_LARGE", RangeError],
  ["ERR_CHILD_PROCESS_IPC_REQUIRED", Error],
  ["ERR_CHILD_PROCESS_STDIO_MAXBUFFER", RangeError],
  ["ERR_CLOSED_MESSAGE_PORT", Error],
  ["ERR_CONSOLE_WRITABLE_STREAM", TypeError, "TypeError"],
  ["ERR_CONSTRUCT_CALL_INVALID", TypeError],
  ["ERR_CONSTRUCT_CALL_REQUIRED", TypeError],
  ["ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED", Error],
  ["ERR_CRYPTO_ECDH_INVALID_FORMAT", TypeError],
  ["ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY", Error],
  ["ERR_CRYPTO_HASH_FINALIZED", Error],
  ["ERR_CRYPTO_HASH_UPDATE_FAILED", Error],
  ["ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS", Error],
  ["ERR_CRYPTO_INCOMPATIBLE_KEY", Error],
  ["ERR_CRYPTO_INITIALIZATION_FAILED", Error],
  ["ERR_CRYPTO_INVALID_AUTH_TAG", TypeError],
  ["ERR_CRYPTO_INVALID_COUNTER", TypeError],
  ["ERR_CRYPTO_INVALID_CURVE", TypeError],
  ["ERR_CRYPTO_INVALID_DIGEST", TypeError],
  ["ERR_CRYPTO_INVALID_IV", TypeError],
  ["ERR_CRYPTO_INVALID_JWK", TypeError],
  ["ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE", TypeError],
  ["ERR_CRYPTO_INVALID_KEYLEN", RangeError],
  ["ERR_CRYPTO_INVALID_KEYPAIR", RangeError],
  ["ERR_CRYPTO_INVALID_KEYTYPE", RangeError],
  ["ERR_CRYPTO_INVALID_MESSAGELEN", RangeError],
  ["ERR_CRYPTO_INVALID_SCRYPT_PARAMS", RangeError],
  ["ERR_CRYPTO_INVALID_STATE", Error],
  ["ERR_CRYPTO_INVALID_TAG_LENGTH", RangeError],
  ["ERR_CRYPTO_JOB_INIT_FAILED", Error],
  ["ERR_CRYPTO_JWK_UNSUPPORTED_CURVE", Error],
  ["ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE", Error],
  ["ERR_CRYPTO_OPERATION_FAILED", Error],
  ["ERR_CRYPTO_SCRYPT_INVALID_PARAMETER", Error],
  ["ERR_CRYPTO_SIGN_KEY_REQUIRED", Error],
  ["ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH", RangeError],
  ["ERR_CRYPTO_UNKNOWN_CIPHER", Error],
  ["ERR_CRYPTO_UNKNOWN_DH_GROUP", Error],
  ["ERR_CRYPTO_UNSUPPORTED_OPERATION", Error],
  ["ERR_DIR_CLOSED", Error],
  ["ERR_DLOPEN_DISABLED", Error],
  ["ERR_DLOPEN_FAILED", Error],
  ["ERR_DNS_SET_SERVERS_FAILED", Error],
  ["ERR_ENCODING_INVALID_ENCODED_DATA", TypeError],
  ["ERR_ENCODING_NOT_SUPPORTED", RangeError],
  ["ERR_EVENT_RECURSION", Error],
  ["ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE", Error],
  ["ERR_FORMDATA_PARSE_ERROR", TypeError],
  ["ERR_FS_CP_DIR_TO_NON_DIR", Error],
  ["ERR_FS_CP_EINVAL", Error],
  ["ERR_FS_CP_FIFO_PIPE", Error],
  ["ERR_FS_CP_NON_DIR_TO_DIR", Error],
  ["ERR_FS_CP_SOCKET", Error],
  ["ERR_FS_CP_UNKNOWN", Error],
  ["ERR_FS_EISDIR", Error],
  ["ERR_HTTP_BODY_NOT_ALLOWED", Error],
  ["ERR_HTTP_HEADERS_SENT", Error],
  ["ERR_HTTP_CONTENT_LENGTH_MISMATCH", Error],
  ["ERR_HTTP_INVALID_HEADER_VALUE", TypeError],
  ["ERR_HTTP_INVALID_STATUS_CODE", RangeError],
  ["ERR_HTTP_TRAILER_INVALID", Error],
  ["ERR_HTTP_SOCKET_ASSIGNED", Error],
  ["ERR_HTTP2_ALTSVC_INVALID_ORIGIN", TypeError],
  ["ERR_HTTP2_ALTSVC_LENGTH", TypeError],
  ["ERR_HTTP2_ERROR", Error],
  ["ERR_HTTP2_HEADER_SINGLE_VALUE", TypeError],
  ["ERR_HTTP2_HEADERS_AFTER_RESPOND", Error],
  ["ERR_HTTP2_HEADERS_SENT", Error],
  ["ERR_HTTP2_INFO_STATUS_NOT_ALLOWED", RangeError],
  ["ERR_HTTP2_INVALID_HEADER_VALUE", TypeError],
  ["ERR_HTTP2_INVALID_INFO_STATUS", RangeError],
  ["ERR_HTTP2_INVALID_ORIGIN", TypeError],
  ["ERR_HTTP2_INVALID_PSEUDOHEADER", TypeError],
  ["ERR_HTTP2_INVALID_SESSION", Error],
  ["ERR_HTTP2_INVALID_STREAM", Error],
  ["ERR_HTTP2_MAX_PENDING_SETTINGS_ACK", Error],
  ["ERR_HTTP2_NO_SOCKET_MANIPULATION", Error],
  ["ERR_HTTP2_ORIGIN_LENGTH", TypeError],
  ["ERR_HTTP2_OUT_OF_STREAMS", Error],
  ["ERR_HTTP2_PAYLOAD_FORBIDDEN", Error],
  ["ERR_HTTP2_PING_CANCEL", Error],
  ["ERR_HTTP2_PING_LENGTH", RangeError],
  ["ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED", TypeError],
  ["ERR_HTTP2_PUSH_DISABLED", Error],
  ["ERR_HTTP2_SEND_FILE_NOSEEK", Error],
  ["ERR_HTTP2_SEND_FILE", Error],
  ["ERR_HTTP2_SESSION_ERROR", Error],
  ["ERR_HTTP2_SOCKET_UNBOUND", Error],
  ["ERR_HTTP2_STATUS_101", Error],
  ["ERR_HTTP2_STATUS_INVALID", RangeError],
  ["ERR_HTTP2_STREAM_ERROR", Error],
  ["ERR_HTTP2_TRAILERS_ALREADY_SENT", Error],
  ["ERR_HTTP2_TRAILERS_NOT_READY", Error],
  ["ERR_HTTP2_TOO_MANY_CUSTOM_SETTINGS", Error],
  ["ERR_HTTP2_UNSUPPORTED_PROTOCOL", Error],
  ["ERR_ILLEGAL_CONSTRUCTOR", TypeError],
  ["ERR_INCOMPATIBLE_OPTION_PAIR", TypeError],
  ["ERR_INVALID_ADDRESS", Error],
  ["ERR_INVALID_ADDRESS_FAMILY", RangeError],
  ["ERR_INVALID_ARG_TYPE", TypeError],
  ["ERR_INVALID_ARG_VALUE", TypeError],
  ["ERR_INVALID_ASYNC_ID", RangeError],
  ["ERR_INVALID_CHAR", TypeError],
  ["ERR_INVALID_CURSOR_POS", TypeError],
  ["ERR_INVALID_FILE_URL_HOST", TypeError],
  ["ERR_INVALID_FILE_URL_PATH", TypeError],
  ["ERR_INVALID_HANDLE_TYPE", TypeError],
  ["ERR_INVALID_HTTP_TOKEN", TypeError],
  ["ERR_INVALID_IP_ADDRESS", TypeError],
  ["ERR_INVALID_MIME_SYNTAX", TypeError],
  ["ERR_INVALID_MODULE", Error],
  ["ERR_INVALID_OBJECT_DEFINE_PROPERTY", TypeError],
  ["ERR_INVALID_PACKAGE_CONFIG", Error],
  ["ERR_INVALID_PROTOCOL", TypeError],
  ["ERR_INVALID_RETURN_VALUE", TypeError],
  ["ERR_INVALID_STATE", Error, undefined, TypeError, RangeError],
  ["ERR_INVALID_THIS", TypeError],
  ["ERR_INVALID_URI", URIError],
  ["ERR_INVALID_URL_SCHEME", TypeError],
  ["ERR_INVALID_URL", TypeError],
  ["ERR_IPC_CHANNEL_CLOSED", Error],
  ["ERR_IPC_DISCONNECTED", Error],
  ["ERR_IPC_ONE_PIPE", Error],
  ["ERR_LOAD_SQLITE_EXTENSION", Error],
  ["ERR_MEMORY_ALLOCATION_FAILED", Error],
  ["ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE", Error],
  ["ERR_METHOD_NOT_IMPLEMENTED", Error],
  ["ERR_MISSING_ARGS", TypeError],
  ["ERR_MISSING_PASSPHRASE", TypeError],
  ["ERR_MISSING_PLATFORM_FOR_WORKER", Error],
  ["ERR_MODULE_NOT_FOUND", Error],
  ["ERR_MULTIPLE_CALLBACK", Error],
  ["ERR_NON_CONTEXT_AWARE_DISABLED", Error],
  ["ERR_OUT_OF_RANGE", RangeError],
  ["ERR_PARSE_ARGS_INVALID_OPTION_VALUE", TypeError],
  ["ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL", TypeError],
  ["ERR_PARSE_ARGS_UNKNOWN_OPTION", TypeError],
  ["ERR_POSTGRES_AUTHENTICATION_FAILED_PBKDF2", Error, "PostgresError"],
  ["ERR_POSTGRES_CONNECTION_CLOSED", Error, "PostgresError"],
  ["ERR_POSTGRES_CONNECTION_TIMEOUT", Error, "PostgresError"],
  ["ERR_POSTGRES_EXPECTED_REQUEST", Error, "PostgresError"],
  ["ERR_POSTGRES_EXPECTED_STATEMENT", Error, "PostgresError"],
  ["ERR_POSTGRES_IDLE_TIMEOUT", Error, "PostgresError"],
  ["ERR_POSTGRES_INVALID_BACKEND_KEY_DATA", TypeError, "PostgresError"],
  ["ERR_POSTGRES_INVALID_BINARY_DATA", TypeError, "PostgresError"],
  ["ERR_POSTGRES_INVALID_BYTE_SEQUENCE_FOR_ENCODING", TypeError, "PostgresError"],
  ["ERR_POSTGRES_INVALID_BYTE_SEQUENCE", TypeError, "PostgresError"],
  ["ERR_POSTGRES_INVALID_CHARACTER", TypeError, "PostgresError"],
  ["ERR_POSTGRES_INVALID_MESSAGE_LENGTH", Error, "PostgresError"],
  ["ERR_POSTGRES_INVALID_MESSAGE", Error, "PostgresError"],
  ["ERR_POSTGRES_INVALID_QUERY_BINDING", Error, "PostgresError"],
  ["ERR_POSTGRES_INVALID_SERVER_KEY", Error, "PostgresError"],
  ["ERR_POSTGRES_INVALID_SERVER_SIGNATURE", Error, "PostgresError"],
  ["ERR_POSTGRES_INVALID_TRANSACTION_STATE", Error, "PostgresError"],
  ["ERR_POSTGRES_LIFETIME_TIMEOUT", Error, "PostgresError"],
  ["ERR_POSTGRES_MULTIDIMENSIONAL_ARRAY_NOT_SUPPORTED_YET", Error, "PostgresError"],
  ["ERR_POSTGRES_NOT_TAGGED_CALL", Error, "PostgresError"],
  ["ERR_POSTGRES_NULLS_IN_ARRAY_NOT_SUPPORTED_YET", Error, "PostgresError"],
  ["ERR_POSTGRES_OVERFLOW", TypeError, "PostgresError"],
  ["ERR_POSTGRES_QUERY_CANCELLED", Error, "PostgresError"],
  ["ERR_POSTGRES_SASL_SIGNATURE_INVALID_BASE64", Error, "PostgresError"],
  ["ERR_POSTGRES_SASL_SIGNATURE_MISMATCH", Error, "PostgresError"],
  ["ERR_POSTGRES_SERVER_ERROR", Error, "PostgresError"],
  ["ERR_POSTGRES_SYNTAX_ERROR", SyntaxError, "PostgresError"],
  ["ERR_POSTGRES_TLS_NOT_AVAILABLE", Error, "PostgresError"],
  ["ERR_POSTGRES_TLS_UPGRADE_FAILED", Error, "PostgresError"],
  ["ERR_POSTGRES_UNEXPECTED_MESSAGE", Error, "PostgresError"],
  ["ERR_POSTGRES_UNKNOWN_AUTHENTICATION_METHOD", Error, "PostgresError"],
  ["ERR_POSTGRES_UNKNOWN_FORMAT_CODE", Error, "PostgresError"],
  ["ERR_POSTGRES_UNSAFE_TRANSACTION", Error, "PostgresError"],
  ["ERR_POSTGRES_UNSUPPORTED_ARRAY_FORMAT", TypeError, "PostgresError"],
  ["ERR_POSTGRES_UNSUPPORTED_AUTHENTICATION_METHOD", Error, "PostgresError"],
  ["ERR_POSTGRES_UNSUPPORTED_BYTEA_FORMAT", TypeError, "PostgresError"],
  ["ERR_POSTGRES_UNSUPPORTED_INTEGER_SIZE", TypeError, "PostgresError"],
  ["ERR_POSTGRES_UNSUPPORTED_NUMERIC_FORMAT", TypeError, "PostgresError"],
  ["ERR_REQUIRE_ASYNC_MODULE", Error],
  ["ERR_S3_INVALID_ENDPOINT", Error],
  ["ERR_S3_INVALID_METHOD", Error],
  ["ERR_S3_INVALID_PATH", Error],
  ["ERR_S3_INVALID_SESSION_TOKEN", Error],
  ["ERR_S3_INVALID_SIGNATURE", Error],
  ["ERR_S3_MISSING_CREDENTIALS", Error],
  ["ERR_SCRIPT_EXECUTION_INTERRUPTED", Error],
  ["ERR_SCRIPT_EXECUTION_TIMEOUT", Error],
  ["ERR_SERVER_ALREADY_LISTEN", Error],
  ["ERR_SERVER_NOT_RUNNING", Error],
  ["ERR_SOCKET_ALREADY_BOUND", Error],
  ["ERR_SOCKET_BAD_BUFFER_SIZE", TypeError],
  ["ERR_SOCKET_BAD_PORT", RangeError],
  ["ERR_SOCKET_BAD_TYPE", TypeError],
  ["ERR_SOCKET_CLOSED_BEFORE_CONNECTION", Error],
  ["ERR_SOCKET_CLOSED", Error],
  ["ERR_SOCKET_DGRAM_IS_CONNECTED", Error],
  ["ERR_SOCKET_DGRAM_NOT_CONNECTED", Error],
  ["ERR_SOCKET_DGRAM_NOT_RUNNING", Error],
  ["ERR_STREAM_ALREADY_FINISHED", Error],
  ["ERR_STREAM_CANNOT_PIPE", Error],
  ["ERR_STREAM_DESTROYED", Error],
  ["ERR_STREAM_NULL_VALUES", TypeError],
  ["ERR_STREAM_PREMATURE_CLOSE", Error],
  ["ERR_STREAM_PUSH_AFTER_EOF", Error],
  ["ERR_STREAM_RELEASE_LOCK", Error, "AbortError"],
  ["ERR_STREAM_UNABLE_TO_PIPE", Error],
  ["ERR_STREAM_UNSHIFT_AFTER_END_EVENT", Error],
  ["ERR_STREAM_WRAP", Error],
  ["ERR_STREAM_WRITE_AFTER_END", Error],
  ["ERR_STRING_TOO_LONG", Error],
  ["ERR_TLS_CERT_ALTNAME_FORMAT", SyntaxError],
  ["ERR_TLS_CERT_ALTNAME_INVALID", Error],
  ["ERR_TLS_INVALID_PROTOCOL_METHOD", TypeError],
  ["ERR_TLS_INVALID_PROTOCOL_VERSION", TypeError],
  ["ERR_TLS_PROTOCOL_VERSION_CONFLICT", TypeError],
  ["ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED", Error],
  ["ERR_TLS_RENEGOTIATION_DISABLED", Error],
  ["ERR_TLS_SNI_FROM_SERVER", Error],
  ["ERR_SSL_NO_CIPHER_MATCH", Error],
  ["ERR_UNAVAILABLE_DURING_EXIT", Error],
  ["ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET", Error],
  ["ERR_UNESCAPED_CHARACTERS", TypeError],
  ["ERR_UNHANDLED_ERROR", Error],
  ["ERR_UNKNOWN_CREDENTIAL", Error],
  ["ERR_UNKNOWN_ENCODING", TypeError],
  ["ERR_UNKNOWN_SIGNAL", TypeError],
  ["ERR_USE_AFTER_CLOSE", Error],
  ["ERR_WASI_NOT_STARTED", Error],
  ["ERR_WORKER_INIT_FAILED", Error],
  ["ERR_WORKER_NOT_RUNNING", Error],
  ["ERR_ZLIB_INITIALIZATION_FAILED", Error],
  ["MODULE_NOT_FOUND", Error],
  ["ERR_INTERNAL_ASSERTION", Error],
  ["ERR_OSSL_EVP_INVALID_DIGEST", Error],
  ["ERR_KEY_GENERATION_JOB_FAILED", Error],
  ["ERR_MISSING_OPTION", TypeError],
  ["ERR_REDIS_CONNECTION_CLOSED", Error, "RedisError"],
  ["ERR_REDIS_INVALID_RESPONSE", Error, "RedisError"],
  ["ERR_REDIS_INVALID_BULK_STRING", Error, "RedisError"],
  ["ERR_REDIS_INVALID_ARRAY", Error, "RedisError"],
  ["ERR_REDIS_INVALID_INTEGER", Error, "RedisError"],
  ["ERR_REDIS_INVALID_SIMPLE_STRING", Error, "RedisError"],
  ["ERR_REDIS_INVALID_ERROR_STRING", Error, "RedisError"],
  ["ERR_REDIS_TLS_NOT_AVAILABLE", Error, "RedisError"],
  ["ERR_REDIS_TLS_UPGRADE_FAILED", Error, "RedisError"],
  ["ERR_REDIS_AUTHENTICATION_FAILED", Error, "RedisError"],
  ["ERR_REDIS_INVALID_PASSWORD", Error, "RedisError"],
  ["ERR_REDIS_INVALID_USERNAME", Error, "RedisError"],
  ["ERR_REDIS_INVALID_DATABASE", Error, "RedisError"],
  ["ERR_REDIS_INVALID_COMMAND", Error, "RedisError"],
  ["ERR_REDIS_INVALID_ARGUMENT", Error, "RedisError"],
  ["ERR_REDIS_INVALID_RESPONSE_TYPE", Error, "RedisError"],
  ["ERR_REDIS_CONNECTION_TIMEOUT", Error, "RedisError"],
  ["ERR_REDIS_IDLE_TIMEOUT", Error, "RedisError"],
  ["HPE_UNEXPECTED_CONTENT_LENGTH", Error],
  ["HPE_INVALID_TRANSFER_ENCODING", Error],
  ["HPE_INVALID_EOF_STATE", Error],
  ["HPE_INVALID_METHOD", Error],
  ["HPE_INTERNAL", Error],
  ["ERR_VM_MODULE_STATUS", Error],
  ["ERR_VM_MODULE_ALREADY_LINKED", Error],
  ["ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA", Error],
  ["ERR_VM_MODULE_NOT_MODULE", Error],
  ["ERR_VM_MODULE_DIFFERENT_CONTEXT", Error],
  ["ERR_VM_MODULE_LINK_FAILURE", Error],
  ["ERR_VM_MODULE_CACHED_DATA_REJECTED", Error],
  ["HPE_INVALID_HEADER_TOKEN", Error],
  ["HPE_HEADER_OVERFLOW", Error],
];
export default errors;
