Translate

Tuesday 5 October 2021

ExceptionHandling in Groovy Scripting grrovy training in telugu 33

 Watch This Video

https://youtu.be/VnLR1LEz7CE

------------------------------------------------------------------------------------------------------

def foo(){
//do stuff
throw new Exception("Foo Exception")
}
List log=[]
try{
foo()
}
catch(Exception e){
log <<e.message
}
finally{
log <<'finally'
}
println log

//Java 7 version multiple catch block

try{

//do something

}
catch (FileNotFoundException | NullPointerException)
{
println e.class.name
println e.message
}

No comments:

Post a Comment

Note: only a member of this blog may post a comment.