add error handler to proxy