MySQL Exception Handling on Duplicate Entry

Follow my instructions. Python defines it’s own Exception datatype, and only catches that and its subclasses by default. To catch non-python exceptions, you must explicit catch java.lang.Exception.