@ingeze/api-error - v1.0.8
    Preparing search index...

    Class ValidationError

    Represents a generic validation error (HTTP 422).

    This error is thrown when the client sends data that is syntactically correct but semantically invalid (e.g., missing required fields, invalid formats).

    Can be instantiated with either a custom message, type, and optional details, or directly with a details object.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new ValidationError instance with optional details.

      Parameters

      • Optionaldetails: Record<string, unknown>

        Additional error details describing the validation failure.

      Returns ValidationError

    • Creates a new ValidationError instance with a custom message, type, and optional details.

      Parameters

      • Optionalmessage: string

        A custom error message describing the validation issue.

      • Optionaltype: ValidationErrorType

        A specific error type identifier.

      • Optionaldetails: Record<string, unknown>

        Additional error details.

      Returns ValidationError

    Properties

    details?: Record<string, unknown>

    Additional error details (optional).

    message: string

    Descriptive error message.

    statusCode: number

    HTTP status code associated with the error.

    success: boolean

    Indicates if the response was successful (always false for errors).

    type: string

    Error type.

    Methods