From 6549b6d4290d75aa6214e908a65b5a5812c1b296 Mon Sep 17 00:00:00 2001 From: Zaki Ali Date: Tue, 15 Apr 2025 09:49:06 -0700 Subject: [PATCH] feat: show error on broken recipe url's (#2197) --- ui/desktop/src/App.tsx | 6 ++++++ ui/desktop/src/components/ErrorBoundary.tsx | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/desktop/src/App.tsx b/ui/desktop/src/App.tsx index 428992f5..0d73ed01 100644 --- a/ui/desktop/src/App.tsx +++ b/ui/desktop/src/App.tsx @@ -300,6 +300,12 @@ export default function App() { // Initialize config first await initConfig(); + // note: if in a non recipe session, recipeConfig is undefined, otherwise null if error + if (recipeConfig === null) { + setFatalError('Cannot read recipe config. Please check the deeplink and try again.'); + return; + } + // Handle bot config extensions first if (recipeConfig?.extensions?.length > 0 && viewType != 'recipeEditor') { console.log('Found extensions in bot config:', recipeConfig.extensions); diff --git a/ui/desktop/src/components/ErrorBoundary.tsx b/ui/desktop/src/components/ErrorBoundary.tsx index a71402c7..26457aed 100644 --- a/ui/desktop/src/components/ErrorBoundary.tsx +++ b/ui/desktop/src/components/ErrorBoundary.tsx @@ -22,16 +22,18 @@ export function ErrorUI({ error }) { -

Honk!

+

Honk!

-

An error occurred.

+

+ An error occurred. +

           {error.message}