Added catching errors if --auto-complete is on and passing them to the auto_complete function