diff --git a/changelog/unreleased/bugfix-deleted-public-link-error-message.md b/changelog/unreleased/bugfix-deleted-public-link-error-message.md new file mode 100644 index 00000000000..b7b3219cf3d --- /dev/null +++ b/changelog/unreleased/bugfix-deleted-public-link-error-message.md @@ -0,0 +1,11 @@ +Bugfix: Show a clear error for deleted public links and files in app views + +Opening a file via a public link in an app such as the preview, after the link +or the file had been deleted, showed the message "Unknown error". The server +answers with an empty 404, which the WebDAV client turns into a generic message, +and app views that failed while loading the folder passed only that message on. +These views now show "The resource could not be located, it may not exist +anymore.", as the other loading paths already did. + +https://github.com/owncloud/ocis/issues/13138 +https://github.com/owncloud/ocis/pull/13156 diff --git a/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue b/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue index 4ef9785d05f..f9c2ca44819 100644 --- a/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue +++ b/web/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue @@ -66,6 +66,7 @@ import { useSharesStore, useFileActionsExportAsPdf, useAppStore, + AppError, useDisableRootOverscroll } from '../../composables' import { @@ -376,7 +377,12 @@ watch( () => appStore.error, () => { if (appStore.error) { - loadingError.value = new Error(appStore.error.message) + const { statusCode, message } = appStore.error as AppError & { statusCode?: number } + loadingError.value = new Error( + statusCode === 404 && message === 'Unknown error' + ? $gettext('The resource could not be located, it may not exist anymore.') + : message + ) loading.value = false return }