mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:02:55 +08:00
Add explanation about try-catch logic in SkinComponentToolbox
This commit is contained in:
parent
1d83b36cfc
commit
e252f1a3cd
@ -8,6 +8,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -74,8 +75,14 @@ namespace osu.Game.Skinning.Editor
|
||||
RequestPlacement = t => RequestPlacement?.Invoke(t)
|
||||
});
|
||||
}
|
||||
catch
|
||||
catch (DependencyNotRegisteredException)
|
||||
{
|
||||
// This loading code relies on try-catching any dependency injection errors to know which components are valid for the current target screen.
|
||||
// If a screen can't provide the required dependencies, a skinnable component should not be displayed in the list.
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e, $"Skin component {type} could not be loaded in the editor component list due to an error");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user