try: cur.execute(sql_query, sql_) self.con.commit() except sqlite3.Error as er: print 'er:', er.message
gives you an error. Or: er.args. This is a list, I donโt know if it can contain more than one item. The first element is the message returned by er.message
Another possibility:
a,b,c = sys.exc_info() for d in traceback.format_exception(a,b,c) : print d,
Sqlite error in c
source share