{"record":{"id":"fcdfdffc59f6deb5","repo":"octobercms/october","slug":"invalid-file-extension-invalid-allowed-extensio-fcdfdf","errorCode":null,"errorMessage":"Invalid file extension: :invalid. Allowed extensions are: :allowed.","messagePattern":"Invalid file extension: :invalid\\. Allowed extensions are: :allowed\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/CmsObject.php","lineNumber":320,"sourceCode":"    }\n\n    //\n    // Internals\n    //\n\n    /**\n     * Converts an exception type thrown by Halcyon to a native CMS exception.\n     * @param Exception $ex\n     */\n    protected static function throwHalcyonException(Exception $ex)\n    {\n        if ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\MissingFileNameException) {\n            throw new ValidationException([\n                'fileName' => Lang::get('cms::lang.cms_object.file_name_required')\n            ]);\n        }\n        elseif ($ex instanceof \\October\\Rain\\Halcyon\\Exception\\InvalidExtensionException) {\n            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' =>","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/CmsObject.php#L302-L338","documentation":"Error \"Invalid file extension: :invalid. Allowed extensions are: :allowed.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/classes/CmsObject.php:320 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"}