Class NotFoundError

Represents a not found error, which is used to indicate that a requested resource could not be found on the server.

This class extends the ClientError class and is used to handle HTTP 404 Not Found errors.

NotFoundError

Hierarchy (view full)

Constructors

Properties

code: number = 404

The HTTP status code representing a not found error.

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

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Serializes the error details into an array of BaseServiceError objects.

    This method creates a structured error response that includes:

    • code: 404 (Not Found)
    • type: "NotFoundError" (the name of the error class)
    • message: A user-friendly message indicating that the requested resource was not found, including the specific resource name.

    Returns BaseServiceError[]

    An array containing the serialized error details.

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void