Hi, I’m not much of a ninja on exception handling in general. In this case I’m trying to gracefully handle a duplicate constraint exception. Currently I’m just trying to capture it with a generic Exception handler, but it still raises the error, and ignores my code to pop-up a message box instead.
Here is the exception with query details ommitted:
_ caused by Exception: Error executing system.db.runPrepUpdate…_
_ caused by GatewayException: SQL error for …_
Duplicate entry ‘1234-5-7’ for key ‘unq_partno_locationid’
_ caused by MySQLIntegrityConstraintViolationException: Duplicate entry ‘1234-5-7’ for key ‘unq_partno_locationid’_
Ignition v7.9.4 (b2017082911)
Java: Oracle Corporation 1.8.0_151
So does it require me to be more specific in the Try/Except to handle the MySQLIntegrityConstraint exception?