@@ -10,7 +10,6 @@ import type { MoveCopyResult } from './moveOrCopyActionUtils.ts'
1010
1111import FolderMoveSvg from '@mdi/svg/svg/folder-move-outline.svg?raw'
1212import CopyIconSvg from '@mdi/svg/svg/folder-multiple-outline.svg?raw'
13- import { isAxiosError } from '@nextcloud/axios'
1413import { FilePickerClosed , getFilePickerBuilder , openConflictPicker , showError , showLoading } from '@nextcloud/dialogs'
1514import { emit } from '@nextcloud/event-bus'
1615import { FileType , getUniqueName , NodeStatus , Permission } from '@nextcloud/files'
@@ -191,21 +190,19 @@ export async function* handleCopyMoveNodesTo(nodes: INode[], destination: IFolde
191190 }
192191 } catch ( error ) {
193192 logger . debug ( `Error while trying to ${ method === MoveCopyAction . COPY ? 'copy' : 'move' } node` , { node, error } )
194- if ( isAxiosError ( error ) ) {
195- if ( error . response ?. status === 412 ) {
196- throw new HintException ( t ( 'files' , 'A file or folder with that name already exists in this folder' ) )
197- } else if ( error . response ?. status === 423 ) {
198- throw new HintException ( t ( 'files' , 'The files are locked' ) )
199- } else if ( error . response ?. status === 404 ) {
200- throw new HintException ( t ( 'files' , 'The file does not exist anymore' ) )
201- } else if ( 'response' in error && error . response ) {
202- const parser = new DOMParser ( )
203- const text = await ( error as WebDAVClientError ) . response ! . text ( )
204- const message = parser . parseFromString ( text ?? '' , 'text/xml' )
205- . querySelector ( 'message' ) ?. textContent
206- if ( message ) {
207- throw new HintException ( message )
208- }
193+ if ( error . response ?. status === 412 ) {
194+ throw new HintException ( t ( 'files' , 'A file or folder with that name already exists in this folder' ) )
195+ } else if ( error . response ?. status === 423 ) {
196+ throw new HintException ( t ( 'files' , 'The files are locked' ) )
197+ } else if ( error . response ?. status === 404 ) {
198+ throw new HintException ( t ( 'files' , 'The file does not exist anymore' ) )
199+ } else if ( 'response' in error && error . response ) {
200+ const parser = new DOMParser ( )
201+ const text = await ( error as WebDAVClientError ) . response ! . text ( )
202+ const message = parser . parseFromString ( text ?? '' , 'text/xml' )
203+ . querySelector ( 'message' ) ?. textContent
204+ if ( message ) {
205+ throw new HintException ( message )
209206 }
210207 }
211208 throw error
0 commit comments