Clean up Parser handle_error function