mirror of
https://bitbucket.org/anguist/ntpa
synced 2026-10-02 00:05:54 +00:00
Improved error handling
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user