Handles errors in the proxy server