Creates a new WorkerError with detailed context information
Primary error message describing what went wrong
Source file path where the error occurred
Block identifier, line number, or position in the file
API documentation element that caused the error
Correct syntax/usage for the element
Example showing proper usage of the element
Optional
extra: anyAdditional context like line/column numbers, validation details
Source file where the error occurred
Block identifier or line number where the error occurred
API documentation element that caused the error (e.g., '@apiParam')
Correct usage definition for the element
Example of correct usage
Additional error context (line numbers, validation details, etc.)
Specialized error class for worker process errors during API documentation parsing
WorkerError extends the base Error class to provide detailed context about parsing failures, including file location, block information, and usage examples. This helps developers quickly identify and fix documentation syntax issues.
Example: Basic usage
Example: Error handling
Since
4.0.0
Public