diff --git a/packages/app/src/prompt/PromptErrorMessage.vue b/packages/app/src/prompt/PromptErrorMessage.vue
new file mode 100644
index 00000000000..d8428dc84c3
--- /dev/null
+++ b/packages/app/src/prompt/PromptErrorMessage.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
cy.prompt
+
+
Get code
+
+
+
+
+
+
+ Something went wrong
+
+ There was a problem with loading the prompt code. Our team has been
+ notified. If the problem persists, please try again later.
+
+
+
+
+
+
+ Close
+
+
+
+
+
+
diff --git a/packages/app/src/prompt/PromptGetCodeModal.vue b/packages/app/src/prompt/PromptGetCodeModal.vue
index 1edd9cc8c81..e7c7e91a0a5 100644
--- a/packages/app/src/prompt/PromptGetCodeModal.vue
+++ b/packages/app/src/prompt/PromptGetCodeModal.vue
@@ -8,7 +8,14 @@
>
@@ -19,6 +26,7 @@ import { init, loadRemote } from '@module-federation/runtime'
import { ref, onMounted, onBeforeUnmount } from 'vue'
import type { CyPromptAppDefaultShape, GetCodeModalContentsShape } from './prompt-app-types'
import { usePromptStore } from '../store/prompt-store'
+import PromptErrorMessage from './PromptErrorMessage.vue'
interface CyPromptApp { default: CyPromptAppDefaultShape }
@@ -44,13 +52,13 @@ const closeModal = () => {
}
const container = ref(null)
-const error = ref(null)
+const hasError = ref(false)
const ReactGetCodeModalContents = ref(null)
const containerReactRootMap = new WeakMap()
const promptStore = usePromptStore()
const maybeRenderReactComponent = () => {
- if (!ReactGetCodeModalContents.value || !!error.value || !container.value) {
+ if (!ReactGetCodeModalContents.value || !!hasError.value || !container.value) {
return
}
@@ -122,7 +130,7 @@ init({
// means that the bundle has been downloaded
loadRemote('cy-prompt').then((module) => {
if (!module?.default) {
- error.value = 'The panel was not loaded successfully'
+ hasError.value = true
return
}
@@ -130,7 +138,7 @@ loadRemote('cy-prompt').then((module) => {
ReactGetCodeModalContents.value = module.default.GetCodeModalContents
maybeRenderReactComponent()
}).catch((e) => {
- error.value = e.message
+ hasError.value = true
})
diff --git a/packages/app/src/prompt/PromptMoreInfoNeededModal.vue b/packages/app/src/prompt/PromptMoreInfoNeededModal.vue
index a1e9609dca0..a0e0f8e6d40 100644
--- a/packages/app/src/prompt/PromptMoreInfoNeededModal.vue
+++ b/packages/app/src/prompt/PromptMoreInfoNeededModal.vue
@@ -8,7 +8,14 @@
>
@@ -19,6 +26,7 @@ import { init, loadRemote } from '@module-federation/runtime'
import { ref, onMounted, onBeforeUnmount } from 'vue'
import type { CyPromptAppDefaultShape, MoreInfoNeededModalContentsShape } from './prompt-app-types'
import { usePromptStore } from '../store/prompt-store'
+import PromptErrorMessage from './PromptErrorMessage.vue'
interface CyPromptApp { default: CyPromptAppDefaultShape }
@@ -44,13 +52,13 @@ const closeModal = () => {
}
const container = ref(null)
-const error = ref(null)
+const hasError = ref(false)
const ReactMoreInfoNeededModalContents = ref(null)
const containerReactRootMap = new WeakMap()
const promptStore = usePromptStore()
const maybeRenderReactComponent = () => {
- if (!ReactMoreInfoNeededModalContents.value || !!error.value || !container.value) {
+ if (!ReactMoreInfoNeededModalContents.value || !!hasError.value || !container.value) {
return
}
@@ -124,7 +132,7 @@ init({
// means that the bundle has been downloaded
loadRemote('cy-prompt').then((module) => {
if (!module?.default) {
- error.value = 'The panel was not loaded successfully'
+ hasError.value = true
return
}
@@ -132,7 +140,7 @@ loadRemote('cy-prompt').then((module) => {
ReactMoreInfoNeededModalContents.value = module.default.MoreInfoNeededModalContents
maybeRenderReactComponent()
}).catch((e) => {
- error.value = e.message
+ hasError.value = true
})