Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
QuestionKeyboard Spy Pin
Saikek11-Apr-07 22:11
Saikek11-Apr-07 22:11 
AnswerRe: Keyboard Spy Pin
Ollie198611-Apr-07 22:18
Ollie198611-Apr-07 22:18 
AnswerRe: Keyboard Spy Pin
Martin#11-Apr-07 22:22
Martin#11-Apr-07 22:22 
QuestionCodeKeep plugin Pin
Saikek11-Apr-07 22:09
Saikek11-Apr-07 22:09 
Questiontry catch (re)throw problem... Pin
Super Lloyd11-Apr-07 21:28
Super Lloyd11-Apr-07 21:28 
AnswerRe: try catch (re)throw problem... Pin
Jaiprakash M Bankolli11-Apr-07 21:34
Jaiprakash M Bankolli11-Apr-07 21:34 
AnswerRe: try catch (re)throw problem... Pin
Stevo Z11-Apr-07 21:44
Stevo Z11-Apr-07 21:44 
AnswerRe: try catch (re)throw problem... Pin
Scott Dorman12-Apr-07 3:04
professionalScott Dorman12-Apr-07 3:04 
You are running in to a problem known as "breaking the stack", which is why the exception doesn't have the relevant stack trace data. You were on the right track, but need to change the code so it looks like this:

C#
catch(Exception ex)
{
    SpecialCleanup();
    throw;
}
The difference here is that throw ex; throws a new exception where throw; re-throws the original exception.

That being said, you really should try to avoid catching general exceptions and catch specific exceptions that you know you can recover from. What is the difference between SpecialCleanup and NormalCleanup?

-----------------------------
In just two days, tomorrow will be yesterday.

GeneralRe: try catch (re)throw problem... Pin
Super Lloyd12-Apr-07 4:05
Super Lloyd12-Apr-07 4:05 
AnswerRe: try catch (re)throw problem... Pin
Vega0212-Apr-07 21:04
Vega0212-Apr-07 21:04 
Questionwhich tools we need when building games ? Pin
kkun11-Apr-07 21:16
kkun11-Apr-07 21:16 
QuestionDVD File Reader Pin
apostleofzion111-Apr-07 21:14
apostleofzion111-Apr-07 21:14 
Questionxml File name error [modified] Pin
7111-Apr-07 21:04
7111-Apr-07 21:04 
AnswerRe: xml File name error Pin
Jaiprakash M Bankolli11-Apr-07 21:29
Jaiprakash M Bankolli11-Apr-07 21:29 
GeneralRe: xml File name error Pin
7111-Apr-07 22:37
7111-Apr-07 22:37 
GeneralRe: xml File name error Pin
Jaiprakash M Bankolli12-Apr-07 0:23
Jaiprakash M Bankolli12-Apr-07 0:23 
GeneralRe: xml File name error Pin
7112-Apr-07 0:38
7112-Apr-07 0:38 
QuestionAdding user defined compiler Error Pin
SakthiSurya11-Apr-07 20:13
SakthiSurya11-Apr-07 20:13 
AnswerRe: Adding user defined compiler Error Pin
Jaiprakash M Bankolli12-Apr-07 0:41
Jaiprakash M Bankolli12-Apr-07 0:41 
QuestionSentinel Loop Question Pin
JMOdom11-Apr-07 19:20
JMOdom11-Apr-07 19:20 
AnswerRe: Sentinel Loop Question Pin
JMOdom12-Apr-07 5:19
JMOdom12-Apr-07 5:19 
QuestionWhy Main? Pin
Saranya B11-Apr-07 19:19
Saranya B11-Apr-07 19:19 
AnswerRe: Why Main? Pin
CPallini11-Apr-07 20:49
mveCPallini11-Apr-07 20:49 
AnswerRe: Why Main? Pin
kkun11-Apr-07 21:25
kkun11-Apr-07 21:25 
AnswerRe: Why Main? Pin
Jaiprakash M Bankolli11-Apr-07 21:45
Jaiprakash M Bankolli11-Apr-07 21:45 

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

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