Constructor for the ControllerError
class.
A unique key identifying the error.
Optional
message:
string
An optional detailed message for the error. If not provided, a default message is generated using the key.
The HTTP status code for the error (default is 400 - Bad Request).
Optional
stack
Static
Optional
prepareOptional override for formatting stack traces
Static
stack
Custom error class to standardize error handling in controllers. Includes a unique key, detailed message, and associated HTTP status code.