Skip to content

Commit

Permalink
Don't crash on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Vort committed Jan 6, 2017
1 parent aabf14d commit 9597bb1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ static bool ProcessArgs(string[] args, ref bool go)
static void Main(string[] args)
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
string exeDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Directory.SetCurrentDirectory(exeDir);

Expand All @@ -79,7 +80,16 @@ static void Main(string[] args)
{
Config.Write();
if (go)
new Tracer();
{
try
{
new Tracer();
}
catch (Exception e)
{
Console.Error.WriteLine(e);
}
}
else
Console.WriteLine("<osm version='0.6'></osm>");
}
Expand Down
2 changes: 1 addition & 1 deletion Tracer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void WriteOsm(List<Vector> result)
}
Console.WriteLine(" <tag k='source:tracer' v='RiverTrace' />");
Console.WriteLine(" <tag k='source:zoomlevel' v='" + Config.Data.zoom + "' />");
Console.WriteLine(" <tag k='width' v='" + riverWidthM.ToString("0.0") + "' />");
Console.WriteLine(" <tag k='width' v='" + Math.Round(riverWidthM).ToString() + "' />");
Console.WriteLine(" <tag k='waterway' v='river' />");
Console.WriteLine(" </way>");
Console.WriteLine("</osm>");
Expand Down

0 comments on commit 9597bb1

Please sign in to comment.