fix mysqldb exception catch bug