log error path as well