A definite +1 for multiple exceptions in a catch{} block.

I have had a number of times I have wanted to do this,

but have had to create a private method and refer all

catch{} blocks to it.





Dan Lydick



> [Original Message]

> From: Henri Yandell <[EMAIL PROTECTED]>

> To: Jakarta General List <[EMAIL PROTECTED]>

> Date: 10/29/04 12:38:48 PM

> Subject: Exception handling   Was: Future JDK features 2 items

>

> 

> 

> 

> 2/

> How about just being able to do multiple Exceptions in one block?

> 

> try {

>      ....

> } catch(JMSException, RemoteException, SQLException e) {

> }

> 

> or possibly even:

> 

> try {

>      ....

> } catch( (JMSException | RemoteException | SQLException) e) {

> }

> 

> The last one is interesting as it could be a larger concept allowing 

> mixed-types; but from a finite set. Probably lots wrong with that idea :)





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to