Add error message to logging