From bb7d020b7ec15937fac583996bd857c36aeddfc4 Mon Sep 17 00:00:00 2001 From: Tao Chen Date: Thu, 16 Mar 2023 10:19:54 -0700 Subject: [PATCH] Better error msgs --- .../src/components/GitHubRepoSelection.tsx | 6 +++--- .../src/components/ServiceConfig.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/apps/github-qna-webapp-react/src/components/GitHubRepoSelection.tsx b/samples/apps/github-qna-webapp-react/src/components/GitHubRepoSelection.tsx index 0cda2b7b2762..7c59f6e83c11 100644 --- a/samples/apps/github-qna-webapp-react/src/components/GitHubRepoSelection.tsx +++ b/samples/apps/github-qna-webapp-react/src/components/GitHubRepoSelection.tsx @@ -39,9 +39,9 @@ const GitHubProjectSelection: FC = ({ uri, keyConfig, onLoadProject, onBa ); setIsLoaded(true); console.log(result); - } catch { + } catch (e) { setIsLoadError(true); - alert('Something went wrong. Please check that the function is running and accessible from this location.'); + alert('Something went wrong.\n\nDetails:\n' + e); } }; @@ -86,7 +86,7 @@ const GitHubProjectSelection: FC = ({ uri, keyConfig, onLoadProject, onBa {isLoading ? (
- Downloading respository... + Downloading repository...
) : ( <> diff --git a/samples/apps/github-qna-webapp-react/src/components/ServiceConfig.tsx b/samples/apps/github-qna-webapp-react/src/components/ServiceConfig.tsx index 8a18562fdb88..19aa08a6b17e 100644 --- a/samples/apps/github-qna-webapp-react/src/components/ServiceConfig.tsx +++ b/samples/apps/github-qna-webapp-react/src/components/ServiceConfig.tsx @@ -36,8 +36,8 @@ const ServiceConfig: FC = ({ uri, onConfigComplete }) => { console.log(result); onConfigComplete(keyConfig); } - catch { - alert('Something went wrong, please check you have the function running and that it is accessible by the web app'); + catch (e) { + alert('Something went wrong.\n\nDetails:\n' + e); } setIsBusy(false);