MySQL Exception Handling

How do something like this in Ignition?
How do you handle MySQL related errors, like duplicate entries?

[code]import mysql.connector

try:
cnx = mysql.connector.connect(user=‘scott’, database=‘employees’)
cursor = cnx.cursor()
cursor.execute(“SELECT * FORM employees”) # Syntax error in query
cnx.close()
except mysql.connector.Error as err:
print(“Something went wrong: {}”.format(err))[/code]