-
Notifications
You must be signed in to change notification settings - Fork 0
Enhancers: ErrorAnalysisEnhancer
alessbarb edited this page Sep 17, 2023
·
2 revisions
File: error-analysis.enhancer.ts
The ErrorAnalysisEnhancer class enhances standard JavaScript Error objects by providing enriched error information like originating file, line number, column number, function name, and more. The class is a part of the error-enhanced library, designed to aid in more granular error tracking and debugging.
| Property | Description |
|---|---|
_originalError |
Holds the original Error object. Defaults to null. |
_parsedStack |
An array containing the parsed stack frames. Defaults to an empty array. |
Sets the original error object and triggers the internal extraction of detailed error information. Returns the instance for method chaining.
Usage Example:
const enhancedError = new ErrorAnalysisEnhancer();
enhancedError.setOriginalError(new Error("Something went wrong"));A getter method that returns the original Error object.
A getter method that returns the parsed stack frames as an array.
-
_extractErrorInfo(): this: Extracts detailed error information from the original error's stack trace and populates_parsedStack.
originalErrorparsedStack
- Debugging: Offers more granular information for debugging purposes.
- Error Logging: Enhanced error details are useful for logging systems.
- Error Analysis: Enables in-depth error analysis by providing additional data points.
error-enhanced Wiki
Version: 1.2.1 - © 2023
🔗 MIT License | 📦 GitHub Repository | 🐞 Report Issues | ✉️ Contact