Log exceptions in sudo command handler