Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
handle 404 when openning files
Signed-off-by: hamza221 <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
hamza221 authored and nextcloud-command committed Feb 27, 2023
commit 16419e6195977781cf426fd5180ff35fbbc80e9f
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,13 @@ export default {
console.debug('File info for ' + path + ' fetched', fileInfo)
await this.openFileInfo(fileInfo, overrideHandlerId)
} catch (error) {
console.error('Could not open file ' + path, error)
if (error?.response?.status === 404) {
logger.error('The file no longer exists, error: ', { error })
showError(t('viewer', 'This file no longer exists'))
this.close()
} else {
console.error('Could not open file ' + path, error)
}
}
},

Expand Down