{"record":{"id":"6cbe8ff641ffba91","repo":"nextcloud/server","slug":"a-file-or-folder-with-that-name-already-exists-in","errorCode":null,"errorMessage":"A file or folder with that name already exists in this folder","messagePattern":"A file or folder with that name already exists in this folder","errorType":"exception","errorClass":"HintException","httpStatus":412,"severity":"error","filePath":"apps/files/src/actions/moveOrCopyAction.ts","lineNumber":198,"sourceCode":"\t\t\t\t\t\t\tconst { data } = await client.stat(\n\t\t\t\t\t\t\t\tdestinationPath,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tdetails: true,\n\t\t\t\t\t\t\t\t\tdata: getDefaultPropfind(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t) as ResponseDataDetailed<FileStat>\n\t\t\t\t\t\t\temit('files:node:created', resultToNode(data))\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait client.moveFile(currentPath, destinationPath)\n\t\t\t\t\t\t// Delete the node as it will be fetched again\n\t\t\t\t\t\t// when navigating to the destination folder\n\t\t\t\t\t\temit('files:node:deleted', node)\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tlogger.debug(`Error while trying to ${method === MoveCopyAction.COPY ? 'copy' : 'move'} node`, { node, error })\n\t\t\t\t\tif (error.response?.status === 412) {\n\t\t\t\t\t\tthrow new HintException(t('files', 'A file or folder with that name already exists in this folder'))\n\t\t\t\t\t} else if (error.response?.status === 423) {\n\t\t\t\t\t\tthrow new HintException(t('files', 'The files are locked'))\n\t\t\t\t\t} else if (error.response?.status === 404) {\n\t\t\t\t\t\tthrow new HintException(t('files', 'The file does not exist anymore'))\n\t\t\t\t\t} else if ('response' in error && error.response) {\n\t\t\t\t\t\tconst parser = new DOMParser()\n\t\t\t\t\t\tconst text = await (error as WebDAVClientError).response!.text()\n\t\t\t\t\t\tconst message = parser.parseFromString(text ?? '', 'text/xml')\n\t\t\t\t\t\t\t.querySelector('message')?.textContent\n\t\t\t\t\t\tif (message) {\n\t\t\t\t\t\t\tthrow new HintException(message)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t} finally {\n\t\t\t\t\tVue.set(node, 'status', undefined)\n\t\t\t\t}\n\t\t\t})","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/files/src/actions/moveOrCopyAction.ts#L180-L216","documentation":"Error \"A file or folder with that name already exists in this folder\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/files/src/actions/moveOrCopyAction.ts:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}