Issue passing selected row data to a pop-up

Python's Exception class doesn't include the panoply of java exceptions that can occur, particularly any SQLException that JDBC can throw. You should include another except Throwable, t: clause for those, where you include a

from java.lang import Throwable

above your try:. (Preferably in a project library script where you delegate your event and action scripts, so it can be imported as a persistent global.)

Also, note that stringifying an exception loses the traceback, which is a real problem for java exceptions, since the traceback has any chained "caused by" inner exceptions. You should log your exceptions, using the logger methods that take a Throwable.