-
Notifications
You must be signed in to change notification settings - Fork 0
Interfaces: ApplicationState
alessbarb edited this page Sep 20, 2023
·
1 revision
File: error-analysis.interface.ts
The ErrorAnalysis interface is a key component of the error-enhanced library. It aims to provide in-depth error analysis, capturing the original error, stack frames, and more. The detailed data gathered through this interface can be highly beneficial for debugging and root cause analysis.
| Property | Type | Description |
|---|---|---|
originalError |
Error | null |
A read-only property representing the original error object, if available. |
parsedStack |
Array<StackFrame> |
A read-only array containing the parsed stack frames from the original error. |
| Method | Return Type | Description |
|---|---|---|
setOriginalError(originalError: Error) |
this |
Sets the original error object and triggers the extraction of the stack frames. Allows for method chaining. |
const error = new ErrorEnhanced([
new ErrorAnalysisEnhancer()
]);
// Setting properties
error.setOriginalError(new Error('Something went wrong'));
// Accessing properties
console.log(error.originalError); // Original Error object
console.log(error.parsedStack); // Parsed stack frames- Use
setOriginalErrorto set the original error object, which also populatesparsedStackfor better root cause analysis. - Inspect properties like
originalErrorandparsedStackfor a comprehensive understanding of the error event.
The ErrorAnalysis interface offers a structured approach to capture in-depth error diagnostics. It is an essential component for effective error management and debugging.
error-enhanced Wiki
Version: 1.2.1 - © 2023
🔗 MIT License | 📦 GitHub Repository | 🐞 Report Issues | ✉️ Contact