Abstract
Constructor for the ServiceError
class.
The internal message used for logging or debugging purposes.
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
Abstract class that serves as the base class for all service-related errors.
This class extends the built-in JavaScript
Error
class and provides a common structure for handling custom error serialization and logging. All custom service errors should extend this class and implement theserializeErrors
method to standardize the error format.