Handle errors from http objects in Proxy to prevent crashes.
Reuse an error-handling function.