Datalayer VS Code Extension - v0.0.4
    Preparing search index...

    Error handler interface for centralized error management. Implementations should provide consistent error handling across the extension.

    interface IErrorHandler {
        handle(error: Error, options?: ErrorHandlerOptions): Promise<void>;
        showError(
            message: string,
            severity?: "error" | "warning" | "info",
            actions?: { action: () => void | Promise<void>; title: string }[],
        ): Promise<void>;
        wrap<T>(
            operation: () => Promise<T>,
            options?: ErrorHandlerOptions,
        ): Promise<T>;
    }

    Implemented by

    Index

    Methods

    • Shows a user-friendly error notification.

      Parameters

      • message: string

        User-friendly error message

      • Optionalseverity: "error" | "warning" | "info"

        Severity level

      • Optionalactions: { action: () => void | Promise<void>; title: string }[]

        Optional actions for the user

      Returns Promise<void>

      Promise resolving to selected action or undefined

    • Wraps an async operation with error handling. Automatically catches and handles errors from the operation.

      Type Parameters

      • T

      Parameters

      • operation: () => Promise<T>

        Async operation to wrap

      • Optionaloptions: ErrorHandlerOptions

        Error handling options

      Returns Promise<T>

      Promise resolving to operation result or undefined on error