From bae2c390bb031b85823637e294c4bfd66b7513cf Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Wed, 23 Mar 2022 15:58:57 +0100 Subject: [PATCH] Improve Color.FromHex exception message. It now includes the invalid hexcode argument. Something in content kept getting these exceptions on prod and knowing the invalid argument would be very helpful when debugging these in the future. --- Robust.Shared.Maths/Color.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Robust.Shared.Maths/Color.cs b/Robust.Shared.Maths/Color.cs index 386e8effd..c98f30be4 100644 --- a/Robust.Shared.Maths/Color.cs +++ b/Robust.Shared.Maths/Color.cs @@ -880,7 +880,7 @@ namespace Robust.Shared.Maths return color.Value; if (fallback.HasValue) return fallback.Value; - throw new ArgumentException("Invalid color code and no fallback provided.", nameof(hexColor)); + throw new ArgumentException($"Invalid color code \"{new string(hexColor)}\" and no fallback provided.", nameof(hexColor)); } public static Color FromXaml(string name)