Constructor
# new InternalError(msg) → {InternalError}
Represents an internal failure (should mean an error in code) with HTTP 500 status code
Error thrown for internal system failures
Parameters:
Name | Type | Description |
---|---|---|
msg |
string
|
Error
|
The error message or Error object |
A new InternalError instance
Example
// Throw an internal error when an unexpected condition occurs
try {
// Some operation
} catch (error) {
throw new InternalError('Unexpected internal error occurred');
}