Skip to content

Commit

Permalink
handle 404 when openning files
Browse files Browse the repository at this point in the history
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
hamza221 authored and backportbot-nextcloud[bot] committed Feb 27, 2023
1 parent 6e3e72f commit 7f73576
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/views/Viewer.vue
Original file line number Diff line number Diff line change
@@ -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)
}
}
},

0 comments on commit 7f73576

Please sign in to comment.