Simplify error logging in example