UNPKG

@restnfeel/agentc-starter-kit

Version:

한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템

46 lines 1.63 kB
/** * @fileoverview Error Boundary component for the RAG chatbot system * @module core/providers/ErrorBoundary */ import React, { Component, ErrorInfo, ReactNode } from "react"; import type { ChatbotError } from "../contexts/ChatbotContext"; interface Props { /** Child components */ children: ReactNode; /** Custom fallback component */ fallback?: ReactNode; /** Error callback */ onError?: (error: ChatbotError, errorInfo: ErrorInfo) => void; /** Whether to show error details in development */ showErrorDetails?: boolean; } interface State { /** Whether an error has occurred */ hasError: boolean; /** The error that occurred */ error: ChatbotError | null; /** Error boundary info */ errorInfo: ErrorInfo | null; } /** * Error Boundary component for catching and handling React errors * in the chatbot system */ export declare class ChatbotErrorBoundary extends Component<Props, State> { constructor(props: Props); static getDerivedStateFromError(error: Error): Partial<State>; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; handleRetry: () => void; render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode>; } /** * Hook for using error boundary in functional components */ export declare const useChatbotErrorHandler: () => { error: ChatbotError; handleError: (error: ChatbotError) => void; clearError: () => void; hasError: boolean; }; export default ChatbotErrorBoundary; //# sourceMappingURL=ErrorBoundary.d.ts.map