diff options
author | Jeremie Laval <jeremie.laval@gmail.com> | 2012-03-30 00:12:57 +0400 |
---|---|---|
committer | Jeremie Laval <jeremie.laval@gmail.com> | 2012-03-30 00:12:57 +0400 |
commit | 9d8c347f02d0e99b2f15287af8426f6ab7b0a580 (patch) | |
tree | aa5290c6bab3130d94e94945956ad9b4291ec89c | |
parent | 278ad061f15e8385102726280b9dcc1215fbdfe9 (diff) |
[appledocwizard] Log errors in a file if possible
-rw-r--r-- | AppleDocWizard/AppleDocWizardController.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/AppleDocWizard/AppleDocWizardController.cs b/AppleDocWizard/AppleDocWizardController.cs index 4e95423..aa430e8 100644 --- a/AppleDocWizard/AppleDocWizardController.cs +++ b/AppleDocWizard/AppleDocWizardController.cs @@ -64,9 +64,11 @@ namespace macdoc ShowAlert (FinishState.NothingToDo); } }).ContinueWith (t => { - Console.WriteLine ("Exception occured during doc process"); - Console.WriteLine (); - Console.WriteLine (t.Exception.ToString ()); + var errorLog = string.Format ("Exception occured during doc process{0}{1}", Environment.NewLine, t.Exception.ToString ()); + Console.WriteLine (errorLog); + try { + System.IO.File.WriteAllText (LogFile, errorLog); + } catch {} ShowAlert (FinishState.Error); }, TaskContinuationOptions.OnlyOnFaulted); } |