guigo@mindspring.com (1) [Avatar] Offline
#1
I just started reading Groovy In Action. I decided to check whether I could avoid a script from terminating in case of an assertion error. I attempted to surround the assertion with a try / catch, it did not work. Is there a way to "catch" assertion errors?

Regards

Rodrigo
Mittie (397) [Avatar] Offline
#2
Re: Try/Catch/Finnaly support for asser
Hi,

try {
assert false
} catch (AssertionError e) {
}

works fine for me. Note that this is an Error, not an Exception.

keep groovin'
Dierk