Improved error handling

This commit is contained in:
2016-03-14 21:38:34 +01:00
parent 182e69786e
commit 8994b34603
26 changed files with 787 additions and 85 deletions
@@ -21,7 +21,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<Commandlineparameters>/home/hawk/code/ntp/rel/conf/ntpa.1.conf</Commandlineparameters>
<Commandlineparameters>~/code/ntpa/example/ntpa.graph.conf</Commandlineparameters>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
+6 -8
View File
@@ -41,22 +41,20 @@ namespace Ntp.Analyzer.Validate.Cli
public static void Main (string[] args)
{
if (args.Length != 1) {
Console.WriteLine("NTP Analyzer validator tool.");
Console.WriteLine ("NTP Analyzer validator tool.");
Console.WriteLine ("Usage: ntpav configuration");
return;
}
string configFile = args [0];
if (!File.Exists (configFile)) {
Console.WriteLine("File does not exists: " + configFile);
return;
}
// Neutralize.
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Configuration config = LoadConfig (configFile);
if (config == null) {
return;
}
Console.WriteLine ("Parsed config ...");
Console.WriteLine (config);
@@ -112,7 +110,7 @@ namespace Ntp.Analyzer.Validate.Cli
} else if (item is StreamDestination) {
StreamDestination destination = item as StreamDestination;
destination.Test ();
Console.Write ("Tested " + destination.AbsoluteLocation);
Console.WriteLine ("Tested " + destination.AbsoluteLocation);
}
}
} catch (Exception ex) {
@@ -125,4 +123,4 @@ namespace Ntp.Analyzer.Validate.Cli
}
}
}
}
}