#UnauthorizedAccessException not handled in LabAPI.Loader

1 messages · Page 1 of 1 (latest)

buoyant lodge
#

Labapi loader can silently stop loading pluigns if it encounters UnauthorizedAccessException. The exception doesn't get printed to the console and can only be found in LocalAdminLogs.

The proposed solution is to add a catch to method loading plugins (screenshot), inside of the foreach

Rethrow as UnauthorizedAccessException: Access to the path '/home/user/.config/SCP Secret Laboratory/LabAPI/configs/7777/PluginName' is denied.
  at System.IO.FileSystem.CreateDirectory (System.String fullPath) [0x00191] in <069d7b80a3914a08b6825aa362b07f5e>:0
  at System.IO.DirectoryInfo.CreateSubdirectory (System.String path) [0x0009f] in <069d7b80a3914a08b6825aa362b07f5e>:0
  at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.CreateSubdirectory(string)
  at LabApi.Loader.ConfigurationLoader.GetConfigDirectory (LabApi.Loader.Features.Plugins.Plugin plugin, System.Boolean isGlobal) [0x00027] in <bea7f403b90e4786abd99fa819db9853>:0
  at LabApi.Loader.ConfigurationLoader.GetConfigPath (LabApi.Loader.Features.Plugins.Plugin plugin, System.String fileName, System.Boolean isGlobal) [0x00000] in <bea7f403b90e4786abd99fa819db9853>:0
  at LabApi.Loader.ConfigurationLoader.TryLoadConfig[TConfig] (LabApi.Loader.Features.Plugins.Plugin plugin, System.String fileName, TConfig& config, System.Boolean isGlobal) [0x00007] in <bea7f403b90e4786abd99fa819db9853>:0
  at LabApi.Loader.ConfigurationLoader.TryLoadProperties (LabApi.Loader.Features.Plugins.Plugin plugin) [0x00000] in <bea7f403b90e4786abd99fa819db9853>:0
  at LabApi.Loader.PluginLoader.EnablePlugins (System.Collections.Generic.IEnumerable`1[T] plugins) [0x00010] in <bea7f403b90e4786abd99fa819db9853>:0
  at LabApi.Loader.PluginLoader.LoadAllPlugins () [0x000af] in <bea7f403b90e4786abd99fa819db9853>:0
  at LabApi.Loader.PluginLoader.Initialize () [0x00022] in <bea7f403b90e4786abd99fa819db9853>:0```
willow meadow
#

Is Plugin private or internal?

neon gazelle
#

Plugin is public

#

or wdym

willow meadow
#

Why would it not have access then?

neon gazelle
#

Rethrow as UnauthorizedAccessException: Access to the path '/home/user/.config/SCP Secret Laboratory/LabAPI/configs/7777/PluginName' is denied.

#

its file access

#

nothing to do with the Plugin class

#

just the accessing of the file

somber tiger
buoyant lodge
#

Instead of crashing silently I would expect it to log that it doesn't have the access it needs

#

Currently what happens if you have the access set up wrong is it says 'enabling all plugins' and then just doesn't, leaving you to figure out why

somber tiger
#

Alright, will fix