@@ -6,10 +6,12 @@ import { computed, onMounted, ref } from "vue";
66import { GalaxyApi } from " @/api" ;
77import { galaxyLogo } from " @/components/icons/galaxyIcons" ;
88import { useConfigStore } from " @/stores/configurationStore" ;
9+ import { errorMessageAsString } from " @/utils/simple-error" ;
910import { getShortToolId } from " @/utils/tool" ;
1011
1112import { createTopicUrl , type HelpForumPost , type HelpForumTopic , useHelpURLs } from " ./helpForumUrls" ;
1213
14+ import Alert from " @/components/Alert.vue" ;
1315import Heading from " @/components/Common/Heading.vue" ;
1416import ExternalLink from " @/components/ExternalLink.vue" ;
1517
@@ -22,6 +24,7 @@ const toolHelpTag = "tool-help";
2224
2325const topics = ref <HelpForumTopic []>([]);
2426const posts = ref <HelpForumPost []>([]);
27+ const errorMessage = ref (" " );
2528const helpAvailable = computed (() => topics .value .length > 0 );
2629
2730const root = ref (null );
@@ -36,7 +39,7 @@ onMounted(async () => {
3639 },
3740 });
3841 if (error ) {
39- console . error ( " Error fetching help forum data " , error );
42+ errorMessage . value = errorMessageAsString ( error , " Failed to search the Help Forum. " );
4043 }
4144
4245 topics .value = data ?.topics ?? [];
@@ -66,12 +69,14 @@ const configStore = useConfigStore();
6669 <div ref =" root" class =" tool-help-forum mt-2 mb-4" >
6770 <Heading h2 separator bold size =" sm" >Help Forum</Heading >
6871
72+ <Alert v-if =" errorMessage" variant =" warning" :message =" errorMessage" />
73+
6974 <p v-if =" helpAvailable" >
7075 Following questions on the
7176 <ExternalLink :href =" configStore.config.help_forum_api_url" > Help Forum </ExternalLink > may be related to
7277 this tool:
7378 </p >
74- <p v-else >
79+ <p v-else-if = " !errorMessage " >
7580 There are no questions on the
7681 <ExternalLink :href =" configStore.config.help_forum_api_url" > Help Forum </ExternalLink >
7782 about this tool.
0 commit comments