From cbff56e23e1e59aff3edee3485a0bb70bb158462 Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Tue, 25 Oct 2022 11:46:01 +0200 Subject: [PATCH 1/2] continue on non 2xx responses --- changelog/unreleased/bugfix-external-app-error-handling | 6 ++++++ packages/web-app-external/src/App.vue | 4 +++- packages/web-runtime/src/helpers/additionalTranslations.ts | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/bugfix-external-app-error-handling diff --git a/changelog/unreleased/bugfix-external-app-error-handling b/changelog/unreleased/bugfix-external-app-error-handling new file mode 100644 index 00000000000..db62a516c04 --- /dev/null +++ b/changelog/unreleased/bugfix-external-app-error-handling @@ -0,0 +1,6 @@ +Bugfix: Handle non 2xx external app responses + +Axios no longer skips on non 200 status responses in app-external. +If the status is not 2xx, the application now displays a proper error message. + +https://github.com/owncloud/web/pull/7861 diff --git a/packages/web-app-external/src/App.vue b/packages/web-app-external/src/App.vue index ce50badf29e..91e8a0f785b 100644 --- a/packages/web-app-external/src/App.vue +++ b/packages/web-app-external/src/App.vue @@ -112,7 +112,9 @@ export default defineComponent({ ...(this.applicationName && { app_name: this.applicationName }) }) const url = `${baseUrl}?${query}` - const response = await this.makeRequest('POST', url) + const response = await this.makeRequest('POST', url, { + validateStatus: () => true + }) if (response.status !== 200) { this.errorMessage = response.message diff --git a/packages/web-runtime/src/helpers/additionalTranslations.ts b/packages/web-runtime/src/helpers/additionalTranslations.ts index a508bfc950c..18849f384f5 100644 --- a/packages/web-runtime/src/helpers/additionalTranslations.ts +++ b/packages/web-runtime/src/helpers/additionalTranslations.ts @@ -4,6 +4,7 @@ function $gettext(msg: string): string { } export const additionalTranslations = { + fileNotAvailable: $gettext('The requested file is not yet available, please try again later.'), activities: $gettext('Activities'), noActivities: $gettext('No activities'), virusDetectedActivity: $gettext( From 9e0a3514adc2ff5de3ef9c7be4a05ed7272a3bce Mon Sep 17 00:00:00 2001 From: Florian Schade Date: Tue, 25 Oct 2022 12:21:20 +0200 Subject: [PATCH 2/2] fix translation --- packages/web-runtime/src/helpers/additionalTranslations.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/web-runtime/src/helpers/additionalTranslations.ts b/packages/web-runtime/src/helpers/additionalTranslations.ts index 18849f384f5..ddfc46c1afd 100644 --- a/packages/web-runtime/src/helpers/additionalTranslations.ts +++ b/packages/web-runtime/src/helpers/additionalTranslations.ts @@ -4,7 +4,9 @@ function $gettext(msg: string): string { } export const additionalTranslations = { - fileNotAvailable: $gettext('The requested file is not yet available, please try again later.'), + fileInProcessing: $gettext( + 'This file is currently being processed and is not yet available for use. Please try again shortly.' + ), activities: $gettext('Activities'), noActivities: $gettext('No activities'), virusDetectedActivity: $gettext(