mysql connection error is thrown as exception