I've kept the same design like geoip_code[2|3]_ex() where it returns true on a successful lookup, false on a failed lookup. It will not return "err" btw. But I understand what you mean, though you can avoid to create another var depending how you code.