improve error handling when sql calling with (empty|unknown) host.

see #191