@@ -66,8 +66,7 @@ export const useRenamingStore = defineStore('renaming', () => {
6666 // Check for extension change for files
6767 if ( node . type === FileType . File
6868 && oldExtension !== newExtension
69- && ! ( await showFileExtensionDialog ( oldExtension , newExtension ) )
70- ) {
69+ && ! ( await showFileExtensionDialog ( oldExtension , newExtension ) ) ) {
7170 // user selected to use the old extension
7271 newName = basename ( newName , newExtension ) + oldExtension
7372 if ( oldName === newName ) {
@@ -78,8 +77,7 @@ export const useRenamingStore = defineStore('renaming', () => {
7877 if ( ! userConfig . userConfig . show_hidden
7978 && newName . startsWith ( '.' )
8079 && ! oldName . startsWith ( '.' )
81- && ! ( await showHiddenFileDialog ( newName ) )
82- ) {
80+ && ! ( await showHiddenFileDialog ( newName ) ) ) {
8381 return false
8482 }
8583 }
@@ -126,7 +124,7 @@ export const useRenamingStore = defineStore('renaming', () => {
126124 if ( isAxiosError ( error ) ) {
127125 // TODO: 409 means current folder does not exist, redirect ?
128126 if ( error ?. response ?. status === 404 ) {
129- throw new Error ( t ( 'files' , 'Could not rename "{oldName}", it does not exist any more' , { oldName } ) )
127+ throw new Error ( t ( 'files' , 'Could not rename "{oldName}", it does not exist any more' , { oldName } ) , { cause : error } )
130128 } else if ( error ?. response ?. status === 412 ) {
131129 throw new Error ( t (
132130 'files' ,
@@ -135,11 +133,11 @@ export const useRenamingStore = defineStore('renaming', () => {
135133 newName,
136134 dir : basename ( renamingNode . value ! . dirname ) ,
137135 } ,
138- ) )
136+ ) , { cause : error } )
139137 }
140138 }
141139 // Unknown error
142- throw new Error ( t ( 'files' , 'Could not rename "{oldName}"' , { oldName } ) )
140+ throw new Error ( t ( 'files' , 'Could not rename "{oldName}"' , { oldName } ) , { cause : error } )
143141 } finally {
144142 Vue . set ( node , 'status' , undefined )
145143 isRenaming . value = false
0 commit comments