Click here to Skip to main content
15,890,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: Automatic insertion of try catch block Pin
OriginalGriff28-Oct-10 4:30
mveOriginalGriff28-Oct-10 4:30 
GeneralRe: Automatic insertion of try catch block Pin
fjdiewornncalwe28-Oct-10 4:33
professionalfjdiewornncalwe28-Oct-10 4:33 
GeneralRe: Automatic insertion of try catch block Pin
OriginalGriff28-Oct-10 4:41
mveOriginalGriff28-Oct-10 4:41 
AnswerRe: Automatic insertion of try catch block Pin
Dave Kreskowiak28-Oct-10 6:25
mveDave Kreskowiak28-Oct-10 6:25 
GeneralRe: Automatic insertion of try catch block Pin
thomforum28-Oct-10 7:49
thomforum28-Oct-10 7:49 
GeneralRe: Automatic insertion of try catch block Pin
jschell28-Oct-10 8:04
jschell28-Oct-10 8:04 
GeneralRe: Automatic insertion of try catch block Pin
fjdiewornncalwe28-Oct-10 9:29
professionalfjdiewornncalwe28-Oct-10 9:29 
GeneralRe: Automatic insertion of try catch block Pin
Pete O'Hanlon28-Oct-10 9:42
mvePete O'Hanlon28-Oct-10 9:42 
You should only use a try/catch if you plan to do something with the exception. Exception handling is intended to provide a defense mechanism, where you can actually handle the exception - what's the point of just consuming it? If you just catch the exception then you don't know that part of your code encountered a problem, so you end up masking problems from a user. As an example, what happens if you have a network connection open and connectivity is lost? If you are writing to the network stream, it's a good idea to know that it's closed unexpectedly during a stream write, so you can inform the user that the write didn't complete successfully.

thomforum wrote:
Tell me one instance where you wouldn't prefer placing a try/catch in a method.


This, effectively, is blind optimism. Use exception handling for what it's intended for.

I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Onyx


GeneralRe: Automatic insertion of try catch block Pin
Dave Kreskowiak28-Oct-10 10:09
mveDave Kreskowiak28-Oct-10 10:09 
AnswerRe: Automatic insertion of try catch block Pin
Eddy Vluggen28-Oct-10 9:35
professionalEddy Vluggen28-Oct-10 9:35 
AnswerRe: Automatic insertion of try catch block Pin
Ravi Bhavnani28-Oct-10 18:49
professionalRavi Bhavnani28-Oct-10 18:49 
AnswerRe: Automatic insertion of try catch block Pin
abinmaths28-Oct-10 20:49
abinmaths28-Oct-10 20:49 
QuestionEdit already created custome Culture Info in C# Pin
Sunil G 328-Oct-10 1:16
Sunil G 328-Oct-10 1:16 
QuestionFTPWebRequest in c# using VPN Connection Pin
Member 378341528-Oct-10 0:16
Member 378341528-Oct-10 0:16 
AnswerMessage Closed Pin
28-Oct-10 1:21
stancrm28-Oct-10 1:21 
GeneralRe: FTPWebRequest in c# using VPN Connection Pin
Member 378341528-Oct-10 1:43
Member 378341528-Oct-10 1:43 
Questionto display the value in ModalpopExtender [modified] Pin
annie_bel27-Oct-10 23:42
annie_bel27-Oct-10 23:42 
AnswerRe: to display the value in ModalpopExtender Pin
Sue Denim28-Oct-10 2:04
Sue Denim28-Oct-10 2:04 
QuestionView blob files from SQL to a Picture Box in Windows form? Pin
ndeza27-Oct-10 22:05
ndeza27-Oct-10 22:05 
AnswerRe: View blob files from SQL to a Picture Box in Windows form? Pin
kadaoui el mehdi27-Oct-10 22:14
kadaoui el mehdi27-Oct-10 22:14 
QuestionCrystal Report Formating Pin
Nikhil Bhivgade27-Oct-10 21:41
professionalNikhil Bhivgade27-Oct-10 21:41 
Questionbutton text to image Pin
Tichaona J27-Oct-10 10:59
Tichaona J27-Oct-10 10:59 
AnswerRe: button text to image Pin
Luc Pattyn27-Oct-10 11:03
sitebuilderLuc Pattyn27-Oct-10 11:03 
GeneralRe: button text to image Pin
Dell.Simmons27-Oct-10 15:17
Dell.Simmons27-Oct-10 15:17 
GeneralRe: button text to image Pin
Luc Pattyn27-Oct-10 16:05
sitebuilderLuc Pattyn27-Oct-10 16:05 

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.