Add Error method to log errors