import { Component, type ErrorInfo, type ReactNode } from "react"; export class ErrorBoundary extends Component< { children: ReactNode }, { error?: Error } > { state: { error?: Error } = {}; static getDerivedStateFromError(error: Error) { return { error }; } componentDidCatch(error: Error, info: ErrorInfo) { console.error("Application failure", error, info); } render() { if (this.state.error) return (

File Tools could not continue

{this.state.error.message}

); return this.props.children; } }