Catch exceptions in the proxy loop