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 246235fc0..e2aef1676 100644 --- a/src/client/spark/core/FontsAndColors/BTSColorExtension.cs +++ b/src/client/spark/core/FontsAndColors/BTSColorExtension.cs @@ -53,7 +53,7 @@ namespace mbts.ui { static BTSColor _get_color(string name) => _color_map.TryGetValue(name, out var color) ? - color() : throw new ColorNotFoundException(); + color() : throw new ColorNotFoundException(name); static IEnumerable<(string, Func)> _normalized_color_props( Type type, string? prefix) {