new BatchError()
This type represents all errors rejected by method batch, except for TypeError when the method receives invalid input parameters.
Properties:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Standard Error property - error type name = |
|||||||||||||||
message |
string | Standard Error property - the error message. It represents the message of the first error encountered in the batch, and is a safe
version of using |
|||||||||||||||
stack |
string | Standard Error property - the stack trace. |
|||||||||||||||
data |
array | Array of objects
The array has the same size as the input one that was passed into method batch, providing direct mapping. |
|||||||||||||||
stat |
Resolution Statistics. Properties
|
||||||||||||||||
first |
The very first error within the batch, with support for nested batch results, it is also the same error as promise.all would provide. |
- Source:
- See:
Extends
Methods
(static) toString(levelopt) → {string}
Creates a well-formatted multi-line string that represents the error.
It is called automatically when writing the object into the console.
The output is an abbreviated version of the error, because the complete error
is often too much for displaying or even logging, as a batch can be of any size.
Therefore, only errors are rendered from the data
property, alongside their indexes,
and only up to the first 5, to avoid polluting the screen or the log file.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
level |
number |
<optional> |
0 | Nested output level, to provide visual offset. |
- Source:
Returns:
- Type
- string