DiscordSRV

DiscordSRV

86.8k Downloads

Disabling DiscordConsoleChannelAllowPluginUpload throws uncaught exception when uploading any attachment

InfoTeddy opened this issue ยท 1 comments

commented

When DiscordConsoleChannelAllowPluginUpload is set to false in config.yml, plugin uploads are disabled. However, what happens instead is that whenever any attachment is uploaded to the console channel, exception errors get printed. Since it's the console channel, the errors also get sent to Discord in the console channel as well, making uploading images in the console channel extremely annoying.

DiscordSRV uncaught exception
An example of the extremely annoying current behavior. To be fair, Java's propensity for obfuscalization verbosity does not help matters here.

This is because if DiscordSRV.isFileSystemLimited() is true (which it is when DiscordConsoleChannelAllowPluginUpload is false), an UnsupportedOperationException gets thrown:

throw new UnsupportedOperationException("File system access has been limited, can't process attachment.");

And it never gets caught.

The correct behavior instead should be to catch the exception and not print any errors at all.

commented

Closing this due to this feature no longer existing.