Consider following sample code
try{
.....
}catch{
case e1:Exception1 => { method1(..)}
case e2:Exception2 => { method2(..)}
case e3:Exception3 => { method3(..)}
}
Now if I'd like to run same method i.e. methodGeneral() to all exception (e1, e2, e3)
however how to avoid to apply the method in each block like below, but can achieve in one shot?
try{
.....
}catch{
case e1:Exception1 => { method1(..); methodGeneral();}
case e2:Exception2 => { method2(..); methodGeneral();}
case e3:Exception3 => { method3(..); methodGeneral();}
}