From d13bee87e7d7e8fa97f4fd586f41c698812e71d5 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Thu, 15 Feb 2018 01:06:12 +0100
Subject: [PATCH] Use XML-style brackets when reporting configuration item
 issues.

---
 ATxCommon/Serializables/ServiceConfig.cs | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ATxCommon/Serializables/ServiceConfig.cs b/ATxCommon/Serializables/ServiceConfig.cs
index a9affb4..525202c 100644
--- a/ATxCommon/Serializables/ServiceConfig.cs
+++ b/ATxCommon/Serializables/ServiceConfig.cs
@@ -313,23 +313,23 @@ namespace ATxCommon.Serializables
                 // if the string is null terminate the validation immediately since this means the
                 // file doesn't contain a required parameter at all:
                 if (value == null) {
-                    var msg = $"mandatory parameter missing: {name}";
+                    var msg = $"mandatory parameter missing: <{name}>";
                     Log.Error(msg);
                     throw new ConfigurationErrorsException(msg);
                 }
 
                 if (string.IsNullOrWhiteSpace(value))
-                    return $"mandatory parameter unset: {name}\n";
+                    return $"mandatory parameter unset: <{name}>\n";
 
                 return string.Empty;
             }
 
             string CheckMinValue(int value, string name, int min) {
                 if (value == 0)
-                    return $"{name} is unset (or set to 0), minimal accepted value is {min}\n";
+                    return $"<{name}> is unset (or set to 0), minimal accepted value is {min}\n";
 
                 if (value < min)
-                    return $"{name} must not be smaller than {min}\n";
+                    return $"<{name}> must not be smaller than {min}\n";
 
                 return string.Empty;
             }
@@ -337,7 +337,7 @@ namespace ATxCommon.Serializables
             string CheckLocalDrive(string value, string name) {
                 var driveType = new DriveInfo(value).DriveType;
                 if (driveType != DriveType.Fixed)
-                    return $"{name} ({value}) must be a local fixed drive, not '{driveType}'!\n";
+                    return $"<{name}> ({value}) must be a local fixed drive, not '{driveType}'!\n";
                 return string.Empty;
             }
 
@@ -374,14 +374,14 @@ namespace ATxCommon.Serializables
 
             // SourceDrive
             if (c.SourceDrive.Substring(1) != @":\")
-                errmsg += "SourceDrive must be of form [X:\\]\n!";
+                errmsg += "<SourceDrive> must be of form [X:\\]\n!";
             errmsg += CheckLocalDrive(c.SourceDrive, nameof(c.SourceDrive));
 
             // spooling directories: IncomingDirectory + ManagedDirectory
             if (c.IncomingDirectory.StartsWith(@"\"))
-                errmsg += "IncomingDirectory must not start with a backslash!\n";
+                errmsg += "<IncomingDirectory> must not start with a backslash!\n";
             if (c.ManagedDirectory.StartsWith(@"\"))
-                errmsg += "ManagedDirectory must not start with a backslash!\n";
+                errmsg += "<ManagedDirectory> must not start with a backslash!\n";
 
             // DestinationDirectory
             if (!Directory.Exists(c.DestinationDirectory))
-- 
GitLab