Base class for all Subnetter errors.

This provides common functionality for all error types including:

  • Standardized error codes
  • Contextual information about the error
  • Helpful user messages

Hierarchy (view full)

Constructors

  • Creates a new SubnetterError.

    Parameters

    • message: string

      Description of the error

    • code: ErrorCode = ErrorCode.UNKNOWN_ERROR

      Error code from ErrorCode enum

    • context: Record<string, unknown> = {}

      Additional context about the error

    Returns SubnetterError

Properties

code: ErrorCode = ErrorCode.UNKNOWN_ERROR

Error code from ErrorCode enum

context: Record<string, unknown> = {}

Additional context about the error

Methods