{"record":{"id":"1b9b29c95bcc797b","repo":"octobercms/october","slug":"cms-lang-cms-object-file-already-exists-1b9b29","errorCode":null,"errorMessage":"cms::lang.cms_object.file_already_exists","messagePattern":"cms::lang\\.cms_object\\.file_already_exists","errorType":"exception","errorClass":"October\\Rain\\Exception\\ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/tailor/classes/Blueprint.php","lineNumber":456,"sourceCode":"    /**\n     * save the object to the disk\n     */\n    public function save(?array $options = null)\n    {\n        $fileName = $this->fileName;\n        $fullPath = $this->getFilePath();\n\n        // Validate\n        $forceSave = Arr::get($options, 'force', false);\n        if ($forceSave) {\n            $this->validateFileName($fileName);\n        }\n        else {\n            $this->validate();\n        }\n\n        if (File::isFile($fullPath) && $this->originalFileName !== $fileName) {\n            throw new ApplicationException(Lang::get(\n                'cms::lang.cms_object.file_already_exists',\n                ['name'=>$fileName]\n            ));\n        }\n\n        $dirPath = $this->getBasePath();\n        if (!file_exists($dirPath) || !is_dir($dirPath)) {\n            if (!File::makeDirectory($dirPath, 0755, true, true)) {\n                throw new ApplicationException(Lang::get(\n                    'cms::lang.cms_object.error_creating_directory',\n                    ['name'=>$dirPath]\n                ));\n            }\n        }\n\n        if (strpos($fileName, '/') !== false) {\n            $dirPath = dirname($fullPath);\n","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/classes/Blueprint.php#L438-L474","documentation":"Error \"cms::lang.cms_object.file_already_exists\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/tailor/classes/Blueprint.php:456 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"}