Click here to Skip to main content
15,921,660 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Sascha Lefèvre20-Jun-15 3:11
professionalSascha Lefèvre20-Jun-15 3:11 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 3:24
Member 1139465220-Jun-15 3:24 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
OriginalGriff20-Jun-15 3:47
mveOriginalGriff20-Jun-15 3:47 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 3:57
Member 1139465220-Jun-15 3:57 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Sascha Lefèvre20-Jun-15 4:03
professionalSascha Lefèvre20-Jun-15 4:03 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 4:17
Member 1139465220-Jun-15 4:17 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
OriginalGriff20-Jun-15 4:29
mveOriginalGriff20-Jun-15 4:29 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 4:47
Member 1139465220-Jun-15 4:47 
We all know that managed .Net exception are derived from Exception class. If you are asking why the rest of derived Exception such as socketexception, Dbexception are created then that is another question. And it won't be necessary to allow multiple catch statement block from the compiler. Off course if you leave/comment out the above socketexception then the error definitely go to exception block, b/c of the reason that I stated above.

Onething sure to know here, you can't determine to refactor the code by looking that code only, even we don't know either a SocketException will occur or not.

G. Day
GeneralRe: Multiple Catch blocks that do the same thing... Pin
OriginalGriff20-Jun-15 5:08
mveOriginalGriff20-Jun-15 5:08 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 5:26
Member 1139465220-Jun-15 5:26 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
OriginalGriff20-Jun-15 5:42
mveOriginalGriff20-Jun-15 5:42 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 6:11
Member 1139465220-Jun-15 6:11 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
OriginalGriff20-Jun-15 6:38
mveOriginalGriff20-Jun-15 6:38 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 7:26
Member 1139465220-Jun-15 7:26 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Sascha Lefèvre20-Jun-15 7:58
professionalSascha Lefèvre20-Jun-15 7:58 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465222-Jun-15 4:24
Member 1139465222-Jun-15 4:24 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Sascha Lefèvre22-Jun-15 4:44
professionalSascha Lefèvre22-Jun-15 4:44 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465222-Jun-15 4:51
Member 1139465222-Jun-15 4:51 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Sascha Lefèvre22-Jun-15 4:56
professionalSascha Lefèvre22-Jun-15 4:56 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465222-Jun-15 5:40
Member 1139465222-Jun-15 5:40 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
OriginalGriff20-Jun-15 8:09
mveOriginalGriff20-Jun-15 8:09 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465222-Jun-15 4:27
Member 1139465222-Jun-15 4:27 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Sascha Lefèvre20-Jun-15 4:44
professionalSascha Lefèvre20-Jun-15 4:44 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Vikram A Punathambekar20-Jun-15 6:31
Vikram A Punathambekar20-Jun-15 6:31 
GeneralRe: Multiple Catch blocks that do the same thing... Pin
Member 1139465220-Jun-15 7:31
Member 1139465220-Jun-15 7:31 

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.