Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Fixed code grammar
Source Link
Marv
  • 3.6k
  • 2
  • 27
  • 49

Do you mean catch an Exception of any type that is thrown, as opposed to just specific Exceptions?

If so:

try { //...file IO... }   catch(Exception e) { //...do stuff with e, such as check its type or log it... } 

Do you mean catch an Exception of any type that is thrown, as opposed to just specific Exceptions?

If so:

try { //...file IO... }  catch(Exception e) { //...do stuff with e, such as check its type or log it... } 

Do you mean catch an Exception of any type that is thrown, as opposed to just specific Exceptions?

If so:

try { //...file IO... } catch(Exception e) { //...do stuff with e, such as check its type or log it... } 

Do you mean catch an ExceptionException of any type that is thrown, as opposed to just specific Exceptions?

If so:

try   {    //...file IO...   } catch(Exception e)   {  //...do stuff with e, such as check its type or log it... } 

Do you mean catch an Exception of any type that is thrown, as opposed to just specific Exceptions?

If so:

try  {   ...file IO...   } catch(Exception e)  { ...do stuff with e, such as check its type or log it... } 

Do you mean catch an Exception of any type that is thrown, as opposed to just specific Exceptions?

If so:

try {  //...file IO... } catch(Exception e) {  //...do stuff with e, such as check its type or log it... } 
Source Link
JoshJordan
  • 13k
  • 10
  • 55
  • 65

Do you mean catch an Exception of any type that is thrown, as opposed to just specific Exceptions?

If so:

try { ...file IO... } catch(Exception e) { ...do stuff with e, such as check its type or log it... }