Skip to content

Community: FAQ

Alessandro Barbagallo edited this page Sep 19, 2023 · 2 revisions

Frequently Asked Questions (FAQs)

General Questions

Q: What is the main purpose of the error-enhanced package?

A: The error-enhanced package extends the native JavaScript Error object, providing additional properties and methods for comprehensive error handling and reporting.


Q: How do I install the package?

A: Use npm with the command: npm install @labrynx/error-enhanced. For more options, see the Installation Guide.


Q: Can I contribute?

A: Absolutely! Start by opening an issue or a pull request on GitHub. Check out our Contributing Guidelines.


Q: Is it TypeScript compatible?

A: Yes, it provides strongly-typed interfaces for enhanced error objects.


Q: Can I use custom enhancers?

A: Yes, the package is extensible. See the Enhancers section for more.


Q: How do I categorize errors?

A: Use the Category enum. More details are in the Enums section.


Q: What about versioning?

A: We adhere to Semantic Versioning. See the Semantic Versioning page for more.

Q: How is the package tested?

A: We use a combination of unit tests and end-to-end tests to ensure reliability. More details can be found in the Testing section.


Q: Can I log errors to external services?

A: Yes, the package is designed to be extensible, allowing integration with external logging and monitoring services.


Q: Is it possible to extend the existing interfaces?

A: Yes, you can extend the existing interfaces to add custom properties or methods as per your project's needs.


Q: How do I upgrade the package?

A: Use npm update @labrynx/error-enhanced. Make sure to check the Semantic Versioning page for breaking changes.


Q: How do I report a bug or request a feature?

A: Please open a new issue on the GitHub repository. Make sure to follow the issue template for faster resolution.


Q: How are errors serialized for transmission over a network?

A: The package provides a SerializersUtility class, which includes methods for error serialization. Check out the Utilities section for more.


Q: What's the performance impact?

A: The package is optimized for minimal performance impact but it's always good to profile and test in your specific use-case.


Q: Are there any rate limits or limitations?

A: There are no inherent rate limits in the package itself, but always consider the limitations of any third-party services you integrate with.


Enhancer-Specific Questions

ErrorAnalysisEnhancer

Q: What if no original error is set?

A: Properties like _fileInfo, _lineNumber will have default values.

Q: How do I get the full stack trace?

A: Use the fullStack getter.


HttpStatusEnhancer

Q: How are invalid HTTP status codes handled?

A: An error will be thrown for invalid codes.

Q: Can I chain setter methods?

A: Yes, methods return this, allowing chaining.

Q: Limitations on header keys?

A: Keys must be valid, non-empty strings.


IdentifiersEnhancer

Q: What if I set an invalid error code?

A: An error will be thrown.

Q: Can I use multiple instances?

A: Yes, each generates a new unique ID.


SystemContextEnhancer

Q: What if I set an invalid environment?

A: An error will be thrown.

Q: Does it update system uptime?

A: No, use refreshSystemInfo().


UserInfoEnhancer

Q: What if I set an invalid user ID or username?

A: An error will be thrown.

Q: Can this be used independently?

A: Yes, it's designed to be flexible.


Utility-Specific Questions

FilterUtility

Q: What is an "unused" property?

A: If it's null, undefined, an empty string, or -1.

Q: Are any properties always preserved?

A: Yes, 'name' and 'message' are always preserved.

Q: Does it modify the original object?

A: No, it returns a new filtered object.


SerializersUtility

Q: What if serialization fails?

A: An error is logged, and an exception is thrown.

Q: Can I customize serialization?

A: Yes, use the toJSON method with a custom replacer function.


Clone this wiki locally