Click here to Skip to main content
16,006,013 members
Home / Discussions / C#
   

C#

 
AnswerRe: GetThreadPreferredUILanguages Pin
BobJanova14-Sep-11 2:14
BobJanova14-Sep-11 2:14 
QuestionWhere to use Try/Catch block? [modified] Pin
Adam_Dev13-Sep-11 22:21
Adam_Dev13-Sep-11 22:21 
AnswerRe: Where to use Try/Catch block? Pin
BobJanova13-Sep-11 22:40
BobJanova13-Sep-11 22:40 
GeneralRe: Where to use Try/Catch block? [modified] Pin
Adam_Dev13-Sep-11 23:01
Adam_Dev13-Sep-11 23:01 
GeneralRe: Where to use Try/Catch block? Pin
BobJanova14-Sep-11 2:09
BobJanova14-Sep-11 2:09 
AnswerRe: Where to use Try/Catch block? Pin
Pete O'Hanlon13-Sep-11 22:57
mvePete O'Hanlon13-Sep-11 22:57 
GeneralRe: Where to use Try/Catch block? [modified] Pin
Adam_Dev13-Sep-11 23:10
Adam_Dev13-Sep-11 23:10 
GeneralRe: Where to use Try/Catch block? Pin
Pete O'Hanlon13-Sep-11 23:50
mvePete O'Hanlon13-Sep-11 23:50 
OK, the simple way to think of this is to only catch an exception at the point at which you intend to do something with it. In the case you have here, you are logging the fact that something went wrong, but does it make sense to allow processing to continue? That's the question you have to ask whenever you are attempting to place exception handling in your code.

For instance, suppose you have some code to write something over TCP, and there's a failure at one point which throws an exception, do you want to attempt to reacquire a connection or abort the processing of that message at that point? The answer to that question indicates whereabouts you want to place your exception handling - if you want to reacquire, you'd handle the exception at a lower level than you would if you just wanted to abort the whole thing and tell the user that there was a problem.

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Where to use Try/Catch block? Pin
Adam_Dev14-Sep-11 0:26
Adam_Dev14-Sep-11 0:26 
AnswerRe: Where to use Try/Catch block? Pin
Luc Pattyn14-Sep-11 2:11
sitebuilderLuc Pattyn14-Sep-11 2:11 
GeneralRe: Where to use Try/Catch block? Pin
BobJanova14-Sep-11 2:22
BobJanova14-Sep-11 2:22 
GeneralRe: Where to use Try/Catch block? Pin
Adam_Dev14-Sep-11 2:33
Adam_Dev14-Sep-11 2:33 
AnswerRe: Where to use Try/Catch block? Pin
Luc Pattyn14-Sep-11 2:51
sitebuilderLuc Pattyn14-Sep-11 2:51 
JokeArrayList Pin
Subodh Kumar Jain13-Sep-11 20:38
Subodh Kumar Jain13-Sep-11 20:38 
GeneralRe: ArrayList Pin
Wayne Gaylard13-Sep-11 21:04
professionalWayne Gaylard13-Sep-11 21:04 
GeneralRe: ArrayList Pin
PIEBALDconsult14-Sep-11 2:27
mvePIEBALDconsult14-Sep-11 2:27 
GeneralRe: ArrayList Pin
Pete O'Hanlon14-Sep-11 3:51
mvePete O'Hanlon14-Sep-11 3:51 
QuestionError in Custom IIS MMC SnapIn Page ...... Pin
Shazz_Shivang200413-Sep-11 20:23
Shazz_Shivang200413-Sep-11 20:23 
QuestionWho to write HTML code using Csharp Pin
amit_ghosh1813-Sep-11 8:20
amit_ghosh1813-Sep-11 8:20 
AnswerRe: Who to write HTML code using Csharp PinPopular
Eddy Vluggen13-Sep-11 8:33
professionalEddy Vluggen13-Sep-11 8:33 
AnswerRe: Who to write HTML code using Csharp Pin
Matt Meyer13-Sep-11 8:44
Matt Meyer13-Sep-11 8:44 
AnswerRe: Who to write HTML code using Csharp Pin
Ian Shlasko13-Sep-11 8:52
Ian Shlasko13-Sep-11 8:52 
AnswerRe: Who to write HTML code using Csharp Pin
PIEBALDconsult13-Sep-11 10:30
mvePIEBALDconsult13-Sep-11 10:30 
AnswerRe: Who to write HTML code using Csharp Pin
BobJanova13-Sep-11 22:49
BobJanova13-Sep-11 22:49 
Questionasp.net 2010 toolbox items Pin
classy_dog13-Sep-11 3:59
classy_dog13-Sep-11 3:59 

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.