The following would be nice:
connection.use {
// …
} catch (e: UniquenessConstraintException) {
// fix it
} finally {
// other stuff
}
I know “use” is currently a function and finally and catch are (soft) keywords. Also, I’m aware that I can wrap use in a try block so this is probably not worth the trouble. Just throwing the idea out there to see what you folks think.