{"record":{"id":"24730ea527bbb6a3","repo":"octobercms/october","slug":"file-name-already-exists-24730e","errorCode":null,"errorMessage":"File ':name' already exists.","messagePattern":"File ':name' already exists\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/CmsObject.php","lineNumber":338,"sourceCode":"            throw new ValidationException(['fileName' =>\n                Lang::get('cms::lang.cms_object.invalid_file_extension', [\n                    'allowed' => implode(', ', $ex->getAllowedExtensions()),\n                    'invalid' => $ex->getInvalidExtension()\n                ])\n            ]);\n        }\n        elseif ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\InvalidFileNameException) {\n            throw new ValidationException([\n               'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidFileName()])\n            ]);\n        }\n        elseif ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\InvalidDirectoryNameException) {\n            throw new ValidationException([\n               'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidDirectoryName()])\n            ]);\n        }\n        elseif ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\FileExistsException) {\n            throw new ValidationException(['fileName' =>\n                Lang::get('cms::lang.cms_object.file_already_exists', ['name' => $ex->getInvalidPath()])\n            ]);\n        }\n        elseif ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\CreateDirectoryException) {\n            throw new ValidationException(['fileName' =>\n                Lang::get('cms::lang.cms_object.error_creating_directory', ['name' => $ex->getInvalidPath()])\n            ]);\n        }\n        elseif ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\CreateFileException) {\n            throw new ValidationException(['fileName' =>\n                Lang::get('cms::lang.cms_object.error_saving', ['name' => $ex->getInvalidPath()])\n            ]);\n        }\n        else {\n            throw $ex;\n        }\n    }\n}","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/CmsObject.php#L320-L356","documentation":"Error \"File ':name' already exists.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/classes/CmsObject.php:338 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":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}