def validationExceptionT hrown fn Unit Boolean try fn false catch case

1
2
3
4
5
6
7
8
9
def validationExceptionThrown(fn: => Unit):Boolean =
try{
fn
false
}catch{
case e:NxtException.ValidationException => true
case t:Throwable => false
}