-
Notifications
You must be signed in to change notification settings - Fork 0
Interfaces: Filter
alessbarb edited this page Sep 17, 2023
·
2 revisions
File: filter.interface.ts
The Filter
interface is designed to offer a streamlined way to filter out unused or irrelevant data from the error object. This is especially useful when you want to log the error or send it across a network without including unnecessary details.
Method | Return Type | Description |
---|---|---|
filterUnused() |
this |
Filters out unused or irrelevant properties from the error object. Allows for method chaining. |
const error = new ErrorEnhanced([
// ...other enhancers
new FilterUtility()
]);
// Filtering unused properties
error.filterUnused();
// Now the error object will only contain relevant data
- Use the
filterUnused
method before logging the error or sending it to an external service to minimize the data payload and focus on the most relevant information.
The Filter
interface is a simple yet powerful tool for cleaning up your error objects. By making use of this feature, you can focus on the essential details that help in debugging and resolving issues more effectively.
error-enhanced Wiki
Version: 1.2.1 - © 2023
🔗 MIT License | 📦 GitHub Repository | 🐞 Report Issues | ✉️ Contact