Just on a conceptual level, if you are not connected to the Internet, you don't have a internet accessible IP address, so the question is what does your function retrun. You can return the empty string, but in the socket API the NULL string (which is equivalent to the empty string in Pascal) is resolved to the loopback address (127.0.0.1 in IPv4 or ::1 in IPv6). An alternative is that you could return the 0 address (0.0.0.0 in IPv4 or ::0 in IPv6), but this address has other special purposes, e.g. it binds any address. Also there is the question, when you return a dummy address like the 0 address, if you should return an IPv4 or IPv6 address.
Therefore I would suggest that the usage of exceptions to signal that there is no internet connection (and therefore no meaningful external IP address), is actually a good solution for the issue at hand. When calling your function, it either returns a valid IP address, or it raises an exception. Then you avoid the problem with adding a bottom element to a type which is not intended to have a bottom element