Wrapped error in an if condition