Exception handling for MySQL module