Permalink
Browse files

Better exception printing to aid issue #13

  • Loading branch information...
1 parent fc004b4 commit 165cd7fc09371207e50181c37a7e87e8cfcc99a0 @quarnster committed Jun 15, 2012
Showing with 22 additions and 12 deletions.
  1. +22 −12 CompleteSharp.cs
  2. BIN CompleteSharp.exe
View
34 CompleteSharp.cs
@@ -213,7 +213,7 @@ protected Type GetType(MyAppDomain ad, string basename, string[] templateParam)
}
catch (Exception e)
{
- System.Console.Error.WriteLine(e.Message);
+ System.Console.Error.WriteLine("Exception: " + e.Message);
System.Console.Error.WriteLine(e.StackTrace);
}
}
@@ -347,7 +347,7 @@ public bool Execute(string[] args, ArrayList modules)
}
catch (Exception e)
{
- System.Console.Error.WriteLine(e.Message);
+ System.Console.Error.WriteLine("Exception: " + e.Message);
System.Console.Error.WriteLine(e.StackTrace);
}
}
@@ -399,7 +399,7 @@ public bool Execute(string[] args, ArrayList modules)
}
catch (Exception e)
{
- System.Console.Error.WriteLine("exception: " + e.Message);
+ System.Console.Error.WriteLine("Exception: " + e.Message);
System.Console.Error.WriteLine(e.StackTrace);
}
@@ -637,7 +637,8 @@ public bool Execute(string[] args, ArrayList modules)
}
catch (Exception e)
{
- System.Console.Error.WriteLine(e);
+ System.Console.Error.WriteLine("Exception: " + e.Message);
+ System.Console.Error.WriteLine(e.StackTrace);
}
return true;
}
@@ -678,7 +679,7 @@ public void LoadAssemblies()
}
catch (Exception e)
{
- System.Console.Error.WriteLine("exception: " + e.Message);
+ System.Console.Error.WriteLine("Exception: " + e.Message);
System.Console.Error.WriteLine(e.StackTrace);
}
}
@@ -702,12 +703,20 @@ private void CheckUpdate()
bool reload = false;
for (int i = 0; i < times.Length; i++)
{
- FileInfo fi = new FileInfo(assemblies[i]);
- if (fi.LastWriteTime > times[i])
+ try
{
- System.Console.Error.WriteLine("changed: " + assemblies[i] + ", " + fi.LastWriteTime + ", " + times[i]);
- reload = true;
- break;
+ FileInfo fi = new FileInfo(assemblies[i]);
+ if (fi.LastWriteTime > times[i])
+ {
+ System.Console.Error.WriteLine("changed: " + assemblies[i] + ", " + fi.LastWriteTime + ", " + times[i]);
+ reload = true;
+ break;
+ }
+ }
+ catch (Exception e)
+ {
+ System.Console.Error.WriteLine("Exception: " + e.Message);
+ System.Console.Error.WriteLine(e.StackTrace);
}
}
if (reload)
@@ -772,14 +781,15 @@ public static void Main(string[] arg)
}
catch (Exception e)
{
- System.Console.Error.WriteLine(e.Message);
+ System.Console.Error.WriteLine("Exception:" + e.Message);
System.Console.Error.WriteLine(e.StackTrace);
}
}
}
catch (Exception e)
{
- System.Console.Error.WriteLine(e);
+ System.Console.Error.WriteLine("Exception:" + e.Message);
+ System.Console.Error.WriteLine(e.StackTrace);
}
}
}
View
BIN CompleteSharp.exe
Binary file not shown.

0 comments on commit 165cd7f

Please sign in to comment.