diff --git a/src/client/spark/core/Exceptions/ColorNotFoundException.cs b/src/client/spark/core/Exceptions/ColorNotFoundException.cs index bea4a8c50..58a0461bd 100644 --- a/src/client/spark/core/Exceptions/ColorNotFoundException.cs +++ b/src/client/spark/core/Exceptions/ColorNotFoundException.cs @@ -6,8 +6,7 @@ using System.Threading.Tasks; namespace mbts.ui { class ColorNotFoundException : Exception { - public ColorNotFoundException() : base("The color is not defined in BTSColors") { } - public ColorNotFoundException(String message) : base(message) { } - public ColorNotFoundException(String message, Exception inner) : base(message, inner) { } + public ColorNotFoundException(string name = null, Exception inner = null) + : base($"The color '{name}' is not defined in BTSColors", inner) { } } } diff --git a/src/client/spark/core/FontsAndColors/BTSColorExtension.cs b/src/client/spark/core/FontsAndColors/BTSColorExtension.cs index 4cd63d9e2..44fa9b92f 100644 --- a/src/client/spark/core/FontsAndColors/BTSColorExtension.cs +++ b/src/client/spark/core/FontsAndColors/BTSColorExtension.cs @@ -27,7 +27,7 @@ namespace mbts.ui { public static BTSColor get_color(string name) => _color_map.TryGetValue(name, out var color) ? - color() : throw new ColorNotFoundException(); + color() : throw new ColorNotFoundException(name); public override object? ProvideValue(IServiceProvider service_provider) { if (service_provider is null) {