Creates a new instance of ErrorHandler.
Descriptive error message.
OptionalstatusCode: number = 500HTTP status code (default is 500).
Optionaltype: string = 'GENERIC_ERROR'Error type.
Optionaldetails: Record<string, unknown>Additional error details (optional).
OptionaldetailsAdditional error details (optional).
Descriptive error message.
HTTP status code associated with the error.
Indicates if the response was successful (always false for errors).
Error type.
Converts the error instance to a JSON object compatible with the ErrorResponse interface.
Serializable error object.
Custom error handler class for the application.
Extends the base
Errorclass and allows defining errors with additional information such as type, HTTP status code, message, and optional details.Example