CIA Compliance Manager API Documentation - v1.1.6
    Preparing search index...

    Class ErrorService

    Centralized Error Service

    Provides consistent error handling, logging, and user-friendly message generation across the entire application.

    // Log an error with context
    errorService.logError(
    new Error('Data fetch failed'),
    { service: 'ComplianceService', method: 'fetchData' }
    );

    // Get user-friendly message
    const message = errorService.getUserFriendlyMessage(error);

    // Check if error is recoverable
    const canRetry = errorService.canRecover(error);
    Index

    Methods

    • Check if an error can be recovered from

      Parameters

      • error: unknown

        Error to check

      Returns boolean

      True if the error is recoverable

    • Create a formatted error message for display

      Parameters

      • error: unknown

        Error to format

      • includeDetails: boolean = false

        Whether to include technical details

      Returns string

      Formatted error message

    • Get a user-friendly error message

      Parameters

      • error: unknown

        Error to convert to user-friendly message

      Returns string

      User-friendly error message