Handle an IOError exception.
171197
def on_IOError(self, e):
        

        sys.stderr.write("Error: %s: \"%s\"\n" % (e.strerror, e.filename))
174624
protected void throwIfError() throws IOException {
        if (_err != null) {
            _err.addSuppressed(new Throwable());
            if (_err instanceof IOException)
                throw (IOException) _err;
            if (_err instanceof IllegalStateException)
                throw (IllegalStateException) _err;
            throw new IllegalStateException(_err);
        }
    }
1245974
def send_exception(self):
        """"""
        self.compiler.reset()

        exc = traceback.format_exc()
        self.writer.write(exc.encode('utf8'))

        yield from self.writer.drain()
1163337
protected IOException toIoException(Exception e) {
        if (e instanceof IOException) {
            return (IOException) e;
        } else {
            return new IOException("Unexpected failure", e);
        }
    }
167711
def onerror(self, message, source, lineno, colno):
        """"""
        return (message, source, lineno, colno)
1257817
def exception_handle(method):
    """"""

    def wrapper(*args, **kwargs):
        try:
            result = method(*args, **kwargs)
            return result
        except ProxyError:
            LOG.exception('ProxyError when try to get %s.', args)
            raise ProxyError('A proxy error occurred.')
        except ConnectionException:
            LOG.exception('ConnectionError when try to get %s.', args)
            raise ConnectionException('DNS failure, refused connection, etc.')
        except Timeout:
            LOG.exception('Timeout when try to get %s', args)
            raise Timeout('The request timed out.')
        except RequestException:
            LOG.exception('RequestException when try to get %s.', args)
            raise RequestException('Please check out your network.')

    return wrapper
532361
def handle_error(self, error=None):
        """"""
        if _debug: TCPServerActor._debug("handle_error %r", error)

        # pass along to the director
        if error is not None:
            self.director.actor_error(self, error)
        else:
            TCPServer.handle_error(self)
28436
void handleException(Throwable t) {
    if (failure == null) {
      failure = t;

      for (ContextualFuture<?> responseFuture : responseFutures.values()) {
        responseFuture.context.executor().execute(() -> responseFuture.completeExceptionally(t));
      }
      responseFutures.clear();

      for (Listener<Throwable> listener : exceptionListeners) {
        listener.accept(t);
      }
    }
  }
1162395
def catch_exceptions(*exceptions):
    """"""
    def wrap(fn):
        @functools.wraps(fn)
        def wrapped_f(*args, **kwargs):
            try:
                return fn(*args, **kwargs)
            except exceptions:
                t, value, traceback = sys.exc_info()
                # If any resource does not exist, return None instead of raising
                if str(value.status) == '404':
                    return None
                e = CloudApiException(str(value), value.reason, value.status)
                raise_(CloudApiException, e, traceback)
        return wrapped_f
    return wrap
275442
def _handle_oss_error():
    
    try:
        yield

    except _OssError as exception:
        if exception.status in _ERROR_CODES:
            raise _ERROR_CODES[exception.status](
                exception.details.get('Message', ''))
        raise
468838
public void processIOException(IOExceptionEvent event) {
		if(event instanceof IOExceptionEventExt  && ((IOExceptionEventExt)event).getReason() == gov.nist.javax.sip.IOExceptionEventExt.Reason.KeepAliveTimeout) {
			IOExceptionEventExt keepAliveTimeout = ((IOExceptionEventExt)event);

			SipConnector connector = findSipConnector(
	                keepAliveTimeout.getLocalHost(),
	                keepAliveTimeout.getLocalPort(),
	                keepAliveTimeout.getTransport());

			if(connector != null) {
		        for (SipContext sipContext : applicationDeployed.values()) {
		        	final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
		        	sipContext.enterSipContext();
					try {
			            for (SipConnectorListener connectorListener : sipContext.getListeners().getSipConnectorListeners()) {
			            	try {
				                connectorListener.onKeepAliveTimeout(connector,
				                        keepAliveTimeout.getPeerHost(),
				                        keepAliveTimeout.getPeerPort());
			            	} catch (Throwable t) {
								logger.error("SipErrorListener threw exception", t);
							}
			            }
					} finally {
						sipContext.exitSipContext(oldClassLoader);
					}
		        }
//		        return;
			}
		}
		if(dnsServerLocator != null && event.getSource() instanceof ClientTransaction) {
			ClientTransaction ioExceptionTx = (ClientTransaction) event.getSource();
			if(ioExceptionTx.getApplicationData() != null) {
				SipServletMessageImpl sipServletMessageImpl = ((TransactionApplicationData)ioExceptionTx.getApplicationData()).getSipServletMessage();
				if(sipServletMessageImpl != null && sipServletMessageImpl instanceof SipServletRequestImpl) {
					if(logger.isDebugEnabled()) {
						logger.debug("An IOException occured on " + event.getHost() + ":" + event.getPort() + "/" + event.getTransport() + " for source " + event.getSource() + ", trying to visit next hop as per RFC3263");
					}
					if(((SipServletRequestImpl)sipServletMessageImpl).visitNextHop()) {
						return;
					}
				}
			}
		}
		logger.error("An IOException occured on " + event.getHost() + ":" + event.getPort() + "/" + event.getTransport() + " for source " + event.getSource());
	}
992282
def _handle_client_exception():
    
    try:
        yield

    except _ClientException as exception:
        if exception.http_status in _ERROR_CODES:
            raise _ERROR_CODES[exception.http_status](
                exception.http_reason)
        raise
1024698
def handle_error(self, error=None):
        """"""
        if _debug: TCPClientActor._debug("handle_error %r", error)

        # pass along to the director
        if error is not None:
            self.director.actor_error(self, error)
        else:
            TCPClient.handle_error(self)
417612
private void serveError(Status status, String error, RequestHandler requestHandler) throws IOException {
    this.serveError(status, HTTPTrackerErrorMessage.craft(error), requestHandler);
  }
938594
def _handle_processing_error(err, errstream, client):
    """"""

    errors = sorted(err.events, key=operator.attrgetter("index"))
    failed = [e.event for e in errors]
    silent = all(isinstance(e.error, OutOfOrderError) for e in errors)
    if errstream:
        _deliver_errored_events(errstream, failed)
        must_raise = False
    else:
        must_raise = True
    for _, event, error, tb in errors:
        if isinstance(error, OutOfOrderError):
            # Not really an error: do not log this to Sentry
            continue
        try:
            raise six.reraise(*tb)
        except Exception as err:
            if client:
                client.captureException()
            msg = "{}{}: {}".format(type(err).__name__,
                    err.args, json.dumps(event, indent=4))
            rlogger.error(msg, exc_info=tb)
            if must_raise:
                raise
1361416
def handle_exception(error):
        
        response = jsonify(error.to_dict())
        response.status_code = error.status_code
        return response
792659
def handle_error(_, client_addr):
        """"""
        exc_type, exc_value, _ = sys.exc_info()
        if exc_type is socket.error and exc_value[0] == 32:
            pass
        elif exc_type is cPickle.UnpicklingError:
            sys.stderr.write('Invalid connection from {0}\n'
                             .format(client_addr[0]))
        else:
            raise