(config: WorkspaceConfiguration)
| 1 | import { WorkspaceConfiguration } from "vscode"; |
| 2 | |
| 3 | export const generateErrorBoundary = (config: WorkspaceConfiguration) => { |
| 4 | const customErrorBoundary = config.get("errorBoundary"); |
| 5 | |
| 6 | if (customErrorBoundary) { |
| 7 | return customErrorBoundary + "\n"; |
| 8 | } |
| 9 | |
| 10 | return [ |
| 11 | `export function ErrorBoundary(){`, |
| 12 | ` const error = useRouteError();`, |
| 13 | ` if (isRouteErrorResponse(error)) {`, |
| 14 | ` return <div/>`, |
| 15 | ` }`, |
| 16 | ` return <div/>`, |
| 17 | `}`, |
| 18 | ].join("\n"); |
| 19 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected