You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.error('Error while renaming file', { error })
321
332
this.source.rename(oldName)
322
-
this.$refs.renameInput.focus()
323
-
324
-
// TODO: 409 means current folder does not exist, redirect ?
325
-
if (error?.response?.status===404) {
326
-
showError(t('files', 'Could not rename "{oldName}", it does not exist any more', { oldName }))
327
-
return
328
-
} elseif (error?.response?.status===412) {
329
-
showError(t('files', 'The name "{newName}" is already used in the folder "{dir}". Please choose a different name.', { newName, dir: this.currentDir }))
330
-
return
333
+
this.$refs.renameInput?.focus()
334
+
335
+
if (isAxiosError(error)) {
336
+
// TODO: 409 means current folder does not exist, redirect ?
337
+
if (error?.response?.status===404) {
338
+
showError(t('files', 'Could not rename "{oldName}", it does not exist any more', { oldName }))
339
+
return
340
+
} elseif (error?.response?.status===412) {
341
+
showError(t('files', 'The name "{newName}" is already used in the folder "{dir}". Please choose a different name.', { newName, dir: this.currentDir }))
342
+
return
343
+
}
331
344
}
332
345
333
346
// Unknown error
334
347
showError(t('files', 'Could not rename "{oldName}"', { oldName }))
0 commit comments