AcCmErrors: {
    get CANNOT_INVOKE_ABSTRACT_METHOD(): Error;
    get ILLEGAL_PARAMETERS(): ReferenceError;
    get INFINITE_LOOP(): Error;
    get NOT_IMPLEMENTED(): Error;
    get OPERATION_IS_NOT_SUPPORTED(): Error;
    get UNRESOLVED_BOUNDARY_CONFLICT(): Error;
    get ZERO_DIVISION(): Error;
} = ...

Collection of standard error types used throughout the AutoCAD Common library.

Each error getter returns a new instance of the error to prevent shared state issues. Use these predefined errors for consistent error handling and messaging.

Type declaration

  • get CANNOT_INVOKE_ABSTRACT_METHOD(): Error
  • get ILLEGAL_PARAMETERS(): ReferenceError

    Throw error ILLEGAL_PARAMETERS when cannot instantiate from given parameter

  • get INFINITE_LOOP(): Error

    Error to throw from LinkedList:testInfiniteLoop static method in case when circular loop detected in linked list

  • get NOT_IMPLEMENTED(): Error
  • get OPERATION_IS_NOT_SUPPORTED(): Error
  • get UNRESOLVED_BOUNDARY_CONFLICT(): Error

    Error to throw from BooleanOperations module in case when fixBoundaryConflicts not capable to fix it

  • get ZERO_DIVISION(): Error

    Throw error ZERO_DIVISION to catch situation of zero division

import { AcCmErrors } from './AcCmErrors'

// Throw standard errors
throw AcCmErrors.ILLEGAL_PARAMETERS
throw AcCmErrors.NOT_IMPLEMENTED

// Check error types
try {
// some operation
} catch (error) {
if (error.message === AcCmErrors.ZERO_DIVISION.message) {
// handle division by zero
}
}