SystemContext
File: system-context.interface.ts
Introduction
The SystemContext
interface in error-enhanced
is designed to capture system-level information where the error occurred. This can include details about the operating environment, Node.js version, hostname, and more. Having this information readily available can aid in debugging and system monitoring.
Properties
Property | Type | Description |
---|---|---|
|
| A read-only property indicating the environment (e.g., |
|
| A read-only property showing the Node.js version. |
|
| A read-only property for the hostname where the error occurred. |
|
| A read-only property for the CPU architecture (e.g., |
|
| A read-only property for the operating system type (e.g., |
|
| A read-only property for the operating system release version. |
|
| A read-only property for the system uptime in seconds. |
Methods
Method | Return Type | Description |
---|---|---|
|
| Sets the environment. Allows for method chaining. |
|
| Refreshes all the system-related information. Allows for method chaining. |
Example Usage
Best Practices
Use
refreshSystemInfo()
if you suspect that system information might have changed during the application's runtime.Always set the
environment
as soon as the error is captured for more accurate debugging.
Conclusion
The SystemContext
interface is crucial for capturing system-level information, aiding both in debugging and in understanding the environment in which errors occur. This makes it an essential part of a comprehensive error management strategy.