Expected behavior
When trying to load a YamlConfiguration from a file that does not exist, it should somehow tell the user (or dev when deveoping) that the YamlConfiguration did not load correctly.
Observed/Actual behavior
While IOException and InvalidConfigurationException are handled (logged to the console) when trying to load a YamlConfiguration from a nonexistent file, the probably most important FileNotFoundException is not catched in any way visible to the user. Like that, you are not able to know whether your config loaded correctly sometimes. This is just because the catch-block for the FileNotFoundException is empty in the YamlConfiguration class.

Steps/models to reproduce
Just call YamlConfiguration.loadConfiguration() in a plugin of choice and pass a nonexistent file as parameter.
Plugin and Datapack List
Plugin in development process, definitely not the cause.
Paper version
This server is running Paper version 1.21-130-master@b1b5d4c (2024-08-10T10:02:42Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
You are running the latest version
Other
I could not find a way to report bugs for Bukkit, so I just did it here. I know that YamlConfiguration is a class from Bukkit (org.bukkit.configuration.file.YamlConfiguration), but I hope there is a way to fix this and find out whether the configuration has loaded.
Expected behavior
When trying to load a
YamlConfigurationfrom a file that does not exist, it should somehow tell the user (or dev when deveoping) that the YamlConfiguration did not load correctly.Observed/Actual behavior
While
IOExceptionandInvalidConfigurationExceptionare handled (logged to the console) when trying to load aYamlConfigurationfrom a nonexistent file, the probably most importantFileNotFoundExceptionis not catched in any way visible to the user. Like that, you are not able to know whether your config loaded correctly sometimes. This is just because the catch-block for theFileNotFoundExceptionis empty in theYamlConfigurationclass.Steps/models to reproduce
Just call
YamlConfiguration.loadConfiguration()in a plugin of choice and pass a nonexistent file as parameter.Plugin and Datapack List
Plugin in development process, definitely not the cause.
Paper version
This server is running Paper version 1.21-130-master@b1b5d4c (2024-08-10T10:02:42Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
You are running the latest version
Other
I could not find a way to report bugs for Bukkit, so I just did it here. I know that YamlConfiguration is a class from Bukkit (org.bukkit.configuration.file.YamlConfiguration), but I hope there is a way to fix this and find out whether the configuration has loaded.