I have some groovy code like this:
def dest = destSql.dataSet('destination_table')
sourceSql.eachRow('select * from source_table'){row ->
try {
dest.add(ID: row.id)
} catch (SQLException) { //A FK constraint will case some inserts to fail
dest.add(ID: 1)
}
}
I'm running this as a command line script. Everything works fine, but the console outputs the SQLExceptions no matter what. I'd like them to not show up when I handle them, as they only pollute the output. How could I specify this (programmatically, if possible)?
TIA.