clean up error handling and reporting

The hostname is now included whenever the error comes from a remote
host.