Emit error when ip address lookup fails.

Failure can be either an error or a non-error failure (due to OS wonkiness).

And make the error emitted be more specific: pass the `Error` or our custom error.