Click here to Skip to main content
15,887,294 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is try - catch block advisable? Pin
jschell23-Aug-13 13:15
jschell23-Aug-13 13:15 
AnswerRe: Is try - catch block advisable? Pin
SaqibRasheed23-Aug-13 1:48
SaqibRasheed23-Aug-13 1:48 
AnswerRe: Is try - catch block advisable? Pin
Forbiddenx23-Aug-13 2:18
Forbiddenx23-Aug-13 2:18 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen23-Aug-13 2:42
professionalEddy Vluggen23-Aug-13 2:42 
GeneralRe: Is try - catch block advisable? Pin
Forbiddenx23-Aug-13 3:15
Forbiddenx23-Aug-13 3:15 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen23-Aug-13 5:01
professionalEddy Vluggen23-Aug-13 5:01 
GeneralRe: Is try - catch block advisable? Pin
Forbiddenx23-Aug-13 6:37
Forbiddenx23-Aug-13 6:37 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen24-Aug-13 2:49
professionalEddy Vluggen24-Aug-13 2:49 
Forbiddenx wrote:
But, I also bomb out if I use the generic all exception and stop everything in its tracks.
There's the problem; handling a "specific" exception means that you cannot use the generic exception to handle it - it'd be passing in other exceptions that weren't meant to be handled that way. Nice example is a Sql Server that's offline, and a client-app that keeps whining about a password being incorrect (since that was all that's handled locally).

Hence, the best practice would be to catch and handle what you expect, and to log everything else on a higher level.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Is try - catch block advisable? Pin
PIEBALDconsult23-Aug-13 18:55
mvePIEBALDconsult23-Aug-13 18:55 
GeneralRe: Is try - catch block advisable? Pin
jschell23-Aug-13 13:16
jschell23-Aug-13 13:16 
GeneralRe: Is try - catch block advisable? Pin
PIEBALDconsult23-Aug-13 18:55
mvePIEBALDconsult23-Aug-13 18:55 
AnswerRe: Is try - catch block advisable? Pin
Ennis Ray Lynch, Jr.23-Aug-13 3:13
Ennis Ray Lynch, Jr.23-Aug-13 3:13 
GeneralRe: Is try - catch block advisable? Pin
PIEBALDconsult23-Aug-13 18:56
mvePIEBALDconsult23-Aug-13 18:56 
AnswerRe: Is try - catch block advisable? Pin
jschell23-Aug-13 13:26
jschell23-Aug-13 13:26 
AnswerRe: Is try - catch block advisable? Pin
PIEBALDconsult23-Aug-13 16:20
mvePIEBALDconsult23-Aug-13 16:20 
AnswerRe: Is try - catch block advisable? Pin
Abhinav S23-Aug-13 16:44
Abhinav S23-Aug-13 16:44 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen24-Aug-13 0:55
professionalEddy Vluggen24-Aug-13 0:55 
GeneralRe: Is try - catch block advisable? Pin
OriginalGriff24-Aug-13 1:37
mveOriginalGriff24-Aug-13 1:37 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen24-Aug-13 2:34
professionalEddy Vluggen24-Aug-13 2:34 
GeneralRe: Is try - catch block advisable? Pin
OriginalGriff24-Aug-13 2:40
mveOriginalGriff24-Aug-13 2:40 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen24-Aug-13 7:18
professionalEddy Vluggen24-Aug-13 7:18 
GeneralRe: Is try - catch block advisable? Pin
jschell26-Aug-13 8:43
jschell26-Aug-13 8:43 
GeneralRe: Is try - catch block advisable? Pin
OriginalGriff24-Aug-13 1:38
mveOriginalGriff24-Aug-13 1:38 
GeneralRe: Is try - catch block advisable? Pin
Abhinav S24-Aug-13 2:07
Abhinav S24-Aug-13 2:07 
GeneralRe: Is try - catch block advisable? Pin
Eddy Vluggen24-Aug-13 2:39
professionalEddy Vluggen24-Aug-13 2:39 

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.