Click here to Skip to main content
15,926,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting CurrentException without catch. [modified] Pin
Paulo Zemek23-Nov-09 6:22
Paulo Zemek23-Nov-09 6:22 
GeneralRe: Getting CurrentException without catch. Pin
The Man from U.N.C.L.E.23-Nov-09 6:52
The Man from U.N.C.L.E.23-Nov-09 6:52 
GeneralRe: Getting CurrentException without catch. Pin
Paulo Zemek23-Nov-09 7:03
Paulo Zemek23-Nov-09 7:03 
GeneralRe: Getting CurrentException without catch. Pin
Shameel23-Nov-09 7:23
professionalShameel23-Nov-09 7:23 
AnswerRe: Getting CurrentException without catch. [modified] Pin
dojohansen23-Nov-09 8:25
dojohansen23-Nov-09 8:25 
AnswerRe: Getting CurrentException without catch: use Marshal.GetExceptionCode() Pin
Daniel Grunwald23-Nov-09 13:07
Daniel Grunwald23-Nov-09 13:07 
GeneralRe: Getting CurrentException without catch: use Marshal.GetExceptionCode() Pin
Paulo Zemek23-Nov-09 13:12
Paulo Zemek23-Nov-09 13:12 
QuestionParameterless catch? Pin
Etienne_12323-Nov-09 0:20
Etienne_12323-Nov-09 0:20 
Hi
I have a rather simple question. I have quite a few try/catch blocks in my system, but I don't really need to handle the exceptions catched. So I just use something like this:

try
{
     //code
}
catch (Exception error)
{
     //do nothing
}


What I want to know is, since I'm not using "error" that I'm declaring, can I just have a parameterless catch like the following:
try
{
     //code
}
catch
{
     //do nothing
}

AnswerRe: Parameterless catch? PinPopular
dojohansen23-Nov-09 0:23
dojohansen23-Nov-09 0:23 
AnswerRe: Parameterless catch? Pin
Richard MacCutchan23-Nov-09 0:24
mveRichard MacCutchan23-Nov-09 0:24 
GeneralRe: Parameterless catch? Pin
Etienne_12323-Nov-09 0:29
Etienne_12323-Nov-09 0:29 
GeneralRe: Parameterless catch? Pin
dan!sh 23-Nov-09 0:35
professional dan!sh 23-Nov-09 0:35 
GeneralRe: Parameterless catch? Pin
dojohansen23-Nov-09 1:03
dojohansen23-Nov-09 1:03 
GeneralRe: Parameterless catch? Pin
Luc Pattyn23-Nov-09 1:10
sitebuilderLuc Pattyn23-Nov-09 1:10 
GeneralRe: Parameterless catch? Pin
Richard MacCutchan23-Nov-09 2:04
mveRichard MacCutchan23-Nov-09 2:04 
GeneralRe: Parameterless catch? Pin
Eddy Vluggen23-Nov-09 2:21
professionalEddy Vluggen23-Nov-09 2:21 
GeneralRe: Parameterless catch? Pin
Saksida Bojan23-Nov-09 6:15
Saksida Bojan23-Nov-09 6:15 
GeneralRe: Parameterless catch? Pin
Eddy Vluggen23-Nov-09 7:46
professionalEddy Vluggen23-Nov-09 7:46 
GeneralRe: Parameterless catch? Pin
OriginalGriff23-Nov-09 4:13
mveOriginalGriff23-Nov-09 4:13 
GeneralRe: Parameterless catch? Pin
Luc Pattyn23-Nov-09 10:10
sitebuilderLuc Pattyn23-Nov-09 10:10 
AnswerRe: Parameterless catch? Pin
Shameel23-Nov-09 2:05
professionalShameel23-Nov-09 2:05 
AnswerRe: Parameterless catch? Pin
Christian Graus23-Nov-09 2:21
protectorChristian Graus23-Nov-09 2:21 
GeneralRe: Parameterless catch? Pin
Richard MacCutchan23-Nov-09 3:12
mveRichard MacCutchan23-Nov-09 3:12 
GeneralRe: Parameterless catch? Pin
Etienne_12323-Nov-09 3:51
Etienne_12323-Nov-09 3:51 
GeneralRe: Parameterless catch? Pin
Richard MacCutchan23-Nov-09 4:25
mveRichard MacCutchan23-Nov-09 4:25 

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.