Abstract
Creates an instance of ClientError
.
This constructor calls the parent ServiceError
class's constructor and sets the prototype explicitly.
A message used for logging purposes, which describes the nature of the client-side error.
Abstract
codeThe HTTP status code or error code representing the type of error. Must be implemented by subclasses.
Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackAbstract
serializeMethod to serialize the error information into an array of BaseServiceError
objects.
Each custom error class must implement this method to ensure consistent error structure.
Converts the error object into a standardized JSON structure.
errors
with the serialized errors.Static
capture
Represents an abstract client-side error, typically for errors with status codes in the 4xx range.
This abstract class extends the
ServiceError
class and serves as a base for client-related errors such as validation errors, unauthorized access, or resource not found errors.It provides a structure for handling errors caused by the client, and specific client error types (e.g.,
NotFoundError
,UnauthorizedError
) should extend this class.ClientError