CreateError constructor

CreateError({
  1. required String message,
  2. int errorCode = 500,
})

Constructs a CreateError instance.

Throws a custom error with the provided message and optional HTTP status code.

Parameters:

  • message: The error message to be sent to the client.
  • errorCode: The HTTP status code for the error (defaults to 500 if not provided).

Implementation

CreateError({
  required this.message,
  this.errorCode = 500,
});