AcCmErrors: {
    CANNOT_INVOKE_ABSTRACT_METHOD: Error;
    ILLEGAL_PARAMETERS: ReferenceError;
    INFINITE_LOOP: Error;
    NOT_IMPLEMENTED: Error;
    OPERATION_IS_NOT_SUPPORTED: Error;
    UNRESOLVED_BOUNDARY_CONFLICT: Error;
    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

  • ReadonlyCANNOT_INVOKE_ABSTRACT_METHOD: Error
  • ReadonlyILLEGAL_PARAMETERS: ReferenceError

    Throw error ILLEGAL_PARAMETERS when cannot instantiate from given parameter

  • ReadonlyINFINITE_LOOP: Error

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

  • ReadonlyNOT_IMPLEMENTED: Error
  • ReadonlyOPERATION_IS_NOT_SUPPORTED: Error
  • ReadonlyUNRESOLVED_BOUNDARY_CONFLICT: Error

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

  • ReadonlyZERO_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
}
}