log error for try/catch