Skip to content

Commit

Permalink
The build system does not like newer C# features.
Browse files Browse the repository at this point in the history
And FxCop does not like double casting...
  • Loading branch information
mibe committed May 10, 2021
1 parent 75563d2 commit e7b08a4
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Srtm2Osm/ConsoleApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,35 +76,33 @@ public override void ShowHelp ()

public override void ExceptionHandler (Exception ex)
{
if (ex is ArgumentException)
{
#if DEBUG
Console.Error.WriteLine (ex.ToString());
Console.Error.WriteLine(ex.ToString());
#endif
Console.Error.WriteLine ();

Console.Error.WriteLine ();

ArgumentException aex = ex as ArgumentException;
if (aex != null)
{
Console.Error.WriteLine ("ERROR: {0}", ex.Message);
ShowHelp ();
Environment.Exit (1);
}
else if (ex is System.Net.WebException wex)

System.Net.WebException wex = ex as System.Net.WebException;
if (wex != null)
{
Console.Error.WriteLine ();
Console.Error.WriteLine ("An error occurred while accessing the network:");
Console.Error.WriteLine ("{0} ({1})", wex.Message, wex.Status);
if (wex.Response != null)
Console.Error.WriteLine ("URI: {0}", wex.Response.ResponseUri);

Environment.Exit (2);
}
else
{
#if DEBUG
Console.Error.WriteLine (ex.ToString());
#endif
Console.Error.WriteLine ();
Console.Error.WriteLine ("ERROR: {0}", ex);
Environment.Exit (2);
}

Console.Error.WriteLine ("ERROR: {0}", ex);
Environment.Exit (2);
}
}
}

0 comments on commit e7b08a4

Please sign in to comment.