Class ServiceErrorAbstract

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 the serializeErrors method to standardize the error format.

Hierarchy (view full)

Constructors

Properties

code: number

The HTTP status code or error code representing the type of error. Must be implemented by subclasses.

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void