Closed jandriea closed 2 months ago
In the current implementation, the try/except statement cannot catch the _usqliteError unless we use a bare except
import usqlite con = usqlite.connect("data.db") try: con.execute("COMMIT;") except: pass con.close()
In this update, I added the Exception type as the parent class of the _usqliteError. So, we can catch the exception as Exception type
import usqlite con = usqlite.connect("data.db") try: con.execute("COMMIT;") except Exception as e: pass con.close()
Additionally, I also added the usqlite_Error to the global objects so the user can catch the _usqliteError directly
import usqlite con = usqlite.connect("data.db") try: con.execute("COMMIT;") except usqlite.usqlite_Error as e: pass con.close()
Great work @jandriea This a very nice improvement. Thanks for your effort.
In the current implementation, the try/except statement cannot catch the _usqliteError unless we use a bare except
In this update, I added the Exception type as the parent class of the _usqliteError. So, we can catch the exception as Exception type
Additionally, I also added the usqlite_Error to the global objects so the user can catch the _usqliteError directly