Use name of for exceptions.

This commit is contained in:
Matthias Mailänder
2025-07-21 12:57:40 +02:00
committed by Gustas Kažukauskas
parent a4966bc299
commit 53f959e4bf
4 changed files with 5 additions and 5 deletions

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
map = world.Map;
terrainInfo = map.Rules.TerrainInfo as DefaultTerrain;
if (terrainInfo == null)
throw new InvalidDataException("TerrainRenderer can only be used with the DefaultTerrain parser");
throw new InvalidDataException($"{nameof(TerrainRenderer)} can only be used with the {nameof(DefaultTerrain)} parser");
tileCache = new DefaultTileCache(terrainInfo);
}