@@ -7,7 +7,6 @@ import type { IFilePickerButton } from '@nextcloud/dialogs'
77import type { FileStat , ResponseDataDetailed , WebDAVClientError } from 'webdav'
88import type { MoveCopyResult } from './moveOrCopyActionUtils'
99
10- import { isAxiosError } from '@nextcloud/axios'
1110import { FilePickerClosed , getFilePickerBuilder , openConflictPicker , showError , showLoading } from '@nextcloud/dialogs'
1211import { emit } from '@nextcloud/event-bus'
1312import { FileAction , FileType , getUniqueName , NodeStatus , Permission } from '@nextcloud/files'
@@ -196,21 +195,19 @@ export async function * handleCopyMoveNodesTo(nodes: INode[], destination: IFold
196195 }
197196 } catch ( error ) {
198197 logger . debug ( `Error while trying to ${ method === MoveCopyAction . COPY ? 'copy' : 'move' } node` , { node, error } )
199- if ( isAxiosError ( error ) ) {
200- if ( error . response ?. status === 412 ) {
201- throw new HintException ( t ( 'files' , 'A file or folder with that name already exists in this folder' ) )
202- } else if ( error . response ?. status === 423 ) {
203- throw new HintException ( t ( 'files' , 'The files are locked' ) )
204- } else if ( error . response ?. status === 404 ) {
205- throw new HintException ( t ( 'files' , 'The file does not exist anymore' ) )
206- } else if ( 'response' in error && error . response ) {
207- const parser = new DOMParser ( )
208- const text = await ( error as WebDAVClientError ) . response ! . text ( )
209- const message = parser . parseFromString ( text ?? '' , 'text/xml' )
210- . querySelector ( 'message' ) ?. textContent
211- if ( message ) {
212- throw new HintException ( message )
213- }
198+ if ( error . response ?. status === 412 ) {
199+ throw new HintException ( t ( 'files' , 'A file or folder with that name already exists in this folder' ) )
200+ } else if ( error . response ?. status === 423 ) {
201+ throw new HintException ( t ( 'files' , 'The files are locked' ) )
202+ } else if ( error . response ?. status === 404 ) {
203+ throw new HintException ( t ( 'files' , 'The file does not exist anymore' ) )
204+ } else if ( 'response' in error && error . response ) {
205+ const parser = new DOMParser ( )
206+ const text = await ( error as WebDAVClientError ) . response ! . text ( )
207+ const message = parser . parseFromString ( text ?? '' , 'text/xml' )
208+ . querySelector ( 'message' ) ?. textContent
209+ if ( message ) {
210+ throw new HintException ( message )
214211 }
215212 }
216213 throw error
0 commit comments