Click here to Skip to main content
   

C#

 
AnswerRe: C# Keybind for Autoclicker [modified] PinmemberOmegaExtern16-Aug-14 21:44 
GeneralRe: C# Keybind for Autoclicker PinmemberMember 1101699616-Aug-14 21:47 
GeneralRe: C# Keybind for Autoclicker PinmemberOmegaExtern16-Aug-14 21:50 
Questioncheck array value exists Pinmemberscottichrosaviakosmos16-Aug-14 4:11 
AnswerRe: check array value exists Pinmemberjlopez78816-Aug-14 4:34 
GeneralRe: check array value exists Pinmemberscottichrosaviakosmos16-Aug-14 5:03 
AnswerRe: check array value exists PinprotectorOriginalGriff16-Aug-14 4:39 
QuestionCatching exceptions on backgroundworker Pinmemberpjank4215-Aug-14 20:44 
I have implemented a backgroundworker which simulates a turn in a game I have created:
try
                {
 
                    GameObjectHelpers.SimulateTurn();
 
                }
                catch (Exception ex)
                {
                    System.IO.StreamWriter file = new System.IO.StreamWriter(AppSettings.getCommonApplicationDataPath() + "\\log.log");
                    file.WriteLine("{0}: {1} {2}", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), ex.StackTrace);
                    file.WriteLine(ex.Message);
                    file.Close();
                   
 
                }
 
My problem is that the message from the exception is not very useable:
8/15/2014: 5:25 PM at Model.GeneralModel.Helpers.GameObjectHe lpers.DoDailyUpdate()
at Model.GeneralModel.Helpers.GameObjectHe lpers.SimulateTurn()
at Model.GeneralModel.Helpers.WorkersModel .GameObjectWorker.bw_DoWork(Object sender, DoWorkEventArgs e)
 
Is there a better way of catching and logging the exception?
QuestionRe: Catching exceptions on backgroundworker PinprotectorRichard MacCutchan15-Aug-14 22:25 
AnswerRe: Catching exceptions on backgroundworker Pinmemberpjank4216-Aug-14 2:50 
GeneralRe: Catching exceptions on backgroundworker PinprotectorRichard MacCutchan16-Aug-14 6:10 
AnswerRe: Catching exceptions on backgroundworker PinprofessionalEddy Vluggen16-Aug-14 3:10 
AnswerRe: Catching exceptions on backgroundworker Pinmemberjschell17-Aug-14 10:56 
GeneralRe: Catching exceptions on backgroundworker Pinmemberpjank4218-Aug-14 9:40 
QuestionMissing TCP Packets PinmemberM Riaz Bashir15-Aug-14 20:24 
AnswerRe: Missing TCP Packets PinmvpDave Kreskowiak16-Aug-14 5:29 
GeneralRe: Missing TCP Packets PinmemberM Riaz Bashir16-Aug-14 20:54 
AnswerRe: Missing TCP Packets PinprofessionalRob Philpott16-Aug-14 7:34 
GeneralRe: Missing TCP Packets PinmemberM Riaz Bashir16-Aug-14 20:54 
QuestionThread Freeze when trying Abort PinmemberMember 1098515215-Aug-14 13:17 
GeneralRe: Thread Freeze when trying Abort PinmemberPIEBALDconsult15-Aug-14 13:47 
QuestionSummary Report in GridView [modified] Pinmembersk_ko14-Aug-14 23:02 
AnswerRe: Summary Report in GridView PinmemberChris Quinn14-Aug-14 23:36 
AnswerRe: Summary Report in GridView PinprofessionalMycroft Holmes15-Aug-14 0:00 
GeneralScope of Share point and Silverlight PinmemberMember 1059394814-Aug-14 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150302.1 | Last Updated 6 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid