better error logging for mysql module