Return error after logging