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.
This commit is contained in:
Vera Aguilera Puerto
2022-03-23 15:58:57 +01:00
parent 7976926eaf
commit bae2c390bb

View File

@@ -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)