Skip to content

Commit

Permalink
doc: updating lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinuehara committed Nov 16, 2024
1 parent 069450c commit f6f15f0
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
Applications running in Node.js will generally experience four categories of
errors:

- Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError},
* Standard JavaScript errors such as {EvalError}, {SyntaxError}, {RangeError},
{ReferenceError}, {TypeError}, and {URIError}.
- System errors triggered by underlying operating system constraints such
* System errors triggered by underlying operating system constraints such
as attempting to open a file that does not exist or attempting to send data
over a closed socket.
- User-specified errors triggered by application code.
- `AssertionError`s are a special class of error that can be triggered when
* User-specified errors triggered by application code.
* `AssertionError`s are a special class of error that can be triggered when
Node.js detects an exceptional logic violation that should never occur. These
are raised typically by the `node:assert` module.

Expand Down Expand Up @@ -54,7 +54,7 @@ return a {Promise} nor accept a `callback` function, such as

Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:

- Some asynchronous methods returns a {Promise}, you should always take into
* Some asynchronous methods returns a {Promise}, you should always take into
account that it might be rejected. See [`--unhandled-rejections`][] flag for
how the process will react to an unhandled promise rejection.

Expand All @@ -75,7 +75,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:
})();
```

- Most asynchronous methods that accept a `callback` function will accept an
* Most asynchronous methods that accept a `callback` function will accept an
`Error` object passed as the first argument to that function. If that first
argument is not `null` and is an instance of `Error`, then an error occurred
that should be handled.
Expand All @@ -93,7 +93,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:
});
```

- When an asynchronous method is called on an object that is an
* When an asynchronous method is called on an object that is an
[`EventEmitter`][], errors can be routed to that object's `'error'` event.
```js
Expand All @@ -111,7 +111,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:
connection.pipe(process.stdout);
```

- A handful of typically asynchronous methods in the Node.js API may still
* A handful of typically asynchronous methods in the Node.js API may still
use the `throw` mechanism to raise exceptions that must be handled using
`try…catch`. There is no comprehensive list of such methods; please
refer to the documentation of each method to determine the appropriate
Expand Down Expand Up @@ -159,9 +159,9 @@ will either be instances of, or inherit from, the `Error` class.

### `new Error(message[, options])`

- `message` {string}
- `options` {Object}
- `cause` {any} The error that caused the newly created error.
* `message` {string}
* `options` {Object}
* `cause` {any} The error that caused the newly created error.

Creates a new `Error` object and sets the `error.message` property to the
provided text message. If an object is passed as `message`, the text message
Expand All @@ -174,8 +174,8 @@ given by the property `Error.stackTraceLimit`, whichever is smaller.
### `Error.captureStackTrace(targetObject[, constructorOpt])`
- `targetObject` {Object}
- `constructorOpt` {Function}
* `targetObject` {Object}
* `constructorOpt` {Function}
Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
Expand Down Expand Up @@ -223,7 +223,7 @@ a();
### `Error.stackTraceLimit`
- {number}
* {number}
The `Error.stackTraceLimit` property specifies the number of stack frames
collected by a stack trace (whether generated by `new Error().stack` or
Expand All @@ -241,7 +241,7 @@ not capture any frames.
added: v16.9.0
-->
- {any}
* {any}
If present, the `error.cause` property is the underlying cause of the `Error`.
It is used when catching an error and throwing a new one with a different
Expand Down Expand Up @@ -280,7 +280,7 @@ console.log(symptom);
### `error.code`
- {string}
* {string}
The `error.code` property is a string label that identifies the kind of error.
`error.code` is the most stable way to identify an error. It will only change
Expand All @@ -290,7 +290,7 @@ about specific codes.
### `error.message`
- {string}
* {string}
The `error.message` property is the string description of the error as set by
calling `new Error(message)`. The `message` passed to the constructor will also
Expand All @@ -307,7 +307,7 @@ console.error(err.message);
### `error.stack`
- {string}
* {string}
The `error.stack` property is a string describing the point in the code at which
the `Error` was instantiated.
Expand Down Expand Up @@ -365,12 +365,12 @@ makeFaster();
The location information will be one of:
- `native`, if the frame represents a call internal to V8 (as in `[].forEach`).
- `plain-filename.js:line:column`, if the frame represents a call internal
* `native`, if the frame represents a call internal to V8 (as in `[].forEach`).
* `plain-filename.js:line:column`, if the frame represents a call internal
to Node.js.
- `/absolute/path/to/file.js:line:column`, if the frame represents a call in
* `/absolute/path/to/file.js:line:column`, if the frame represents a call in
a user program (using CommonJS module system), or its dependencies.
- `<transport-protocol>:///url/to/module/file.mjs:line:column`, if the frame
* `<transport-protocol>:///url/to/module/file.mjs:line:column`, if the frame
represents a call in a user program (using ES module system), or
its dependencies.
Expand All @@ -383,14 +383,14 @@ loop tick.
## Class: `AssertionError`
- Extends: {errors.Error}
* Extends: {errors.Error}
Indicates the failure of an assertion. For details, see
[`Class: assert.AssertionError`][].
## Class: `RangeError`
- Extends: {errors.Error}
* Extends: {errors.Error}
Indicates that a provided argument was not within the set or range of
acceptable values for a function; whether that is a numeric range, or
Expand All @@ -406,7 +406,7 @@ of argument validation.
## Class: `ReferenceError`
- Extends: {errors.Error}
* Extends: {errors.Error}
Indicates that an attempt is being made to access a variable that is not
defined. Such errors commonly indicate typos in code, or an otherwise broken
Expand All @@ -425,7 +425,7 @@ Unless an application is dynamically generating and running code,
## Class: `SyntaxError`
- Extends: {errors.Error}
* Extends: {errors.Error}
Indicates that a program is not valid JavaScript. These errors may only be
generated and propagated as a result of code evaluation. Code evaluation may
Expand All @@ -445,48 +445,48 @@ they may only be caught by other contexts.
## Class: `SystemError`
- Extends: {errors.Error}
* Extends: {errors.Error}
Node.js generates system errors when exceptions occur within its runtime
environment. These usually occur when an application violates an operating
system constraint. For example, a system error will occur if an application
attempts to read a file that does not exist.
- `address` {string} If present, the address to which a network connection
* `address` {string} If present, the address to which a network connection
failed
- `code` {string} The string error code
- `dest` {string} If present, the file path destination when reporting a file
* `code` {string} The string error code
* `dest` {string} If present, the file path destination when reporting a file
system error
- `errno` {number} The system-provided error number
- `info` {Object} If present, extra details about the error condition
- `message` {string} A system-provided human-readable description of the error
- `path` {string} If present, the file path when reporting a file system error
- `port` {number} If present, the network connection port that is not available
- `syscall` {string} The name of the system call that triggered the error
* `errno` {number} The system-provided error number
* `info` {Object} If present, extra details about the error condition
* `message` {string} A system-provided human-readable description of the error
* `path` {string} If present, the file path when reporting a file system error
* `port` {number} If present, the network connection port that is not available
* `syscall` {string} The name of the system call that triggered the error
### `error.address`
- {string}
* {string}
If present, `error.address` is a string describing the address to which a
network connection failed.
### `error.code`
- {string}
* {string}
The `error.code` property is a string representing the error code.
### `error.dest`
- {string}
* {string}
If present, `error.dest` is the file path destination when reporting a file
system error.
### `error.errno`
- {number}
* {number}
The `error.errno` property is a negative number which corresponds
to the error code defined in [`libuv Error handling`][].
Expand All @@ -498,31 +498,31 @@ To get the string representation of the error code, use
### `error.info`
- {Object}
* {Object}
If present, `error.info` is an object with details about the error condition.
### `error.message`
- {string}
* {string}
`error.message` is a system-provided human-readable description of the error.
### `error.path`
- {string}
* {string}
If present, `error.path` is a string containing a relevant invalid pathname.
### `error.port`
- {number}
* {number}
If present, `error.port` is the network connection port that is not available.
### `error.syscall`
- {string}
* {string}
The `error.syscall` property is a string describing the [syscall][] that failed.
Expand All @@ -531,65 +531,65 @@ The `error.syscall` property is a string describing the [syscall][] that failed.
This is a list of system errors commonly-encountered when writing a Node.js
program. For a comprehensive list, see the [`errno`(3) man page][].
- `EACCES` (Permission denied): An attempt was made to access a file in a way
* `EACCES` (Permission denied): An attempt was made to access a file in a way
forbidden by its file access permissions.
- `EADDRINUSE` (Address already in use): An attempt to bind a server
* `EADDRINUSE` (Address already in use): An attempt to bind a server
([`net`][], [`http`][], or [`https`][]) to a local address failed due to
another server on the local system already occupying that address.
- `ECONNREFUSED` (Connection refused): No connection could be made because the
* `ECONNREFUSED` (Connection refused): No connection could be made because the
target machine actively refused it. This usually results from trying to
connect to a service that is inactive on the foreign host.
- `ECONNRESET` (Connection reset by peer): A connection was forcibly closed by
* `ECONNRESET` (Connection reset by peer): A connection was forcibly closed by
a peer. This normally results from a loss of the connection on the remote
socket due to a timeout or reboot. Commonly encountered via the [`http`][]
and [`net`][] modules.
- `EEXIST` (File exists): An existing file was the target of an operation that
* `EEXIST` (File exists): An existing file was the target of an operation that
required that the target not exist.
- `EISDIR` (Is a directory): An operation expected a file, but the given
* `EISDIR` (Is a directory): An operation expected a file, but the given
pathname was a directory.
- `EMFILE` (Too many open files in system): Maximum number of
* `EMFILE` (Too many open files in system): Maximum number of
[file descriptors][] allowable on the system has been reached, and
requests for another descriptor cannot be fulfilled until at least one
has been closed. This is encountered when opening many files at once in
parallel, especially on systems (in particular, macOS) where there is a low
file descriptor limit for processes. To remedy a low limit, run
`ulimit -n 2048` in the same shell that will run the Node.js process.
- `ENOENT` (No such file or directory): Commonly raised by [`fs`][] operations
* `ENOENT` (No such file or directory): Commonly raised by [`fs`][] operations
to indicate that a component of the specified pathname does not exist. No
entity (file or directory) could be found by the given path.
- `ENOTDIR` (Not a directory): A component of the given pathname existed, but
* `ENOTDIR` (Not a directory): A component of the given pathname existed, but
was not a directory as expected. Commonly raised by [`fs.readdir`][].
- `ENOTEMPTY` (Directory not empty): A directory with entries was the target
* `ENOTEMPTY` (Directory not empty): A directory with entries was the target
of an operation that requires an empty directory, usually [`fs.unlink`][].
- `ENOTFOUND` (DNS lookup failed): Indicates a DNS failure of either
* `ENOTFOUND` (DNS lookup failed): Indicates a DNS failure of either
`EAI_NODATA` or `EAI_NONAME`. This is not a standard POSIX error.
- `EPERM` (Operation not permitted): An attempt was made to perform an
* `EPERM` (Operation not permitted): An attempt was made to perform an
operation that requires elevated privileges.
- `EPIPE` (Broken pipe): A write on a pipe, socket, or FIFO for which there is
* `EPIPE` (Broken pipe): A write on a pipe, socket, or FIFO for which there is
no process to read the data. Commonly encountered at the [`net`][] and
[`http`][] layers, indicative that the remote side of the stream being
written to has been closed.
- `ETIMEDOUT` (Operation timed out): A connect or send request failed because
* `ETIMEDOUT` (Operation timed out): A connect or send request failed because
the connected party did not properly respond after a period of time. Usually
encountered by [`http`][] or [`net`][]. Often a sign that a `socket.end()`
was not properly called.
## Class: `TypeError`
- Extends {errors.Error}
* Extends {errors.Error}
Indicates that a provided argument is not an allowable type. For example,
passing a function to a parameter which expects a string would be a `TypeError`.
Expand Down Expand Up @@ -3058,9 +3058,9 @@ Type stripping is not supported for files descendent of a `node_modules` directo
An attempt was made to resolve an invalid module referrer. This can happen when
importing or calling `import.meta.resolve()` with either:

- a bare specifier that is not a builtin module from a module whose URL scheme
* a bare specifier that is not a builtin module from a module whose URL scheme
is not `file`.
- a [relative URL][] from a module whose URL scheme is not a [special scheme][].
* a [relative URL][] from a module whose URL scheme is not a [special scheme][].

```mjs
try {
Expand Down Expand Up @@ -3105,9 +3105,9 @@ A dynamic import callback was invoked without `--experimental-vm-modules`.
The module attempted to be linked is not eligible for linking, because of one of
the following reasons:

- It has already been linked (`linkingStatus` is `'linked'`)
- It is being linked (`linkingStatus` is `'linking'`)
- Linking has failed for this module (`linkingStatus` is `'errored'`)
* It has already been linked (`linkingStatus` is `'linked'`)
* It is being linked (`linkingStatus` is `'linking'`)
* Linking has failed for this module (`linkingStatus` is `'errored'`)

<a id="ERR_VM_MODULE_CACHED_DATA_REJECTED"></a>

Expand Down

0 comments on commit f6f15f0

Please sign in to comment.