Skip to content

Catch of FileNotFoundException left empty when calling YamlConfiguration.loadConfiguration() in plugin #11620

@reChords25

Description

@reChords25

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.

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething doesn't work as it was intended to.version: 1.21Game version 1.21

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Invalid

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions