Handle any cleanup or similar activity related to an error
        occurring on a pooled connection.
550426
def handle(self, error, connection):
        
        error_class = error.__class__
        if error_class in (ConnectionExpired, ServiceUnavailable, DatabaseUnavailableError):
            self.deactivate(connection.address)
        elif error_class in (NotALeaderError, ForbiddenOnReadOnlyDatabaseError):
            self.remove_writer(connection.address)
438446
def handle_an_error():
    """"""
    import os

    from furious.context import get_current_async

    async = get_current_async()
    async_exception = async.result.payload
    exc_info = async_exception.traceback
    logging.info('async job blew up, exception info: %r', exc_info)

    retries = int(os.environ['HTTP_X_APPENGINE_TASKRETRYCOUNT'])
    if retries < 2:
        raise Exception(async_exception.error)
    else:
        logging.info('Caught too many errors, giving up now.')
1121101
def error_handler(task):
    """"""
    @wraps(task)
    def wrapper(self, *args, **kwargs):
        try:
            return task(self, *args, **kwargs)
        except Exception as e:
            self.connected = False
            if not self.testing:
                exc_type, exc_obj, exc_tb = sys.exc_info()
                fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
                error_message = (
                    "[" + str(datetime.now()) + "] Error in task \"" +
                    task.__name__ + "\" (" +
                    fname + "/" + str(exc_tb.tb_lineno) +
                    ")" + e.message
                )
                self.logger.error("%s: RPC instruction failed" % error_message)
    return wrapper
587120
def _on_error(self, websock, e):
        '''
        
        '''
        if isinstance(e, (
            websocket.WebSocketConnectionClosedException,
            ConnectionResetError)):
            self.logger.error('websocket closed, did chrome die?')
        else:
            self.logger.error(
                    'exception from websocket receiver thread',
                    exc_info=1)
        brozzler.thread_raise(self.calling_thread, BrowsingException)
15884
def handle(self, *args, **options):
        
        from django.db import connection
        connection.close()
        failed_tries = settings.DJANGO_TH.get('failed_tries', 10)
        trigger = TriggerService.objects.filter(
            Q(provider_failed__lte=failed_tries) |
            Q(consumer_failed__lte=failed_tries),
            status=True,
            user__is_active=True,
            provider__name__status=True,
            consumer__name__status=True,
        ).select_related('consumer__name', 'provider__name')

        with ThreadPoolExecutor(max_workers=settings.DJANGO_TH.get('processes')) as executor:
            r = Read()
            for t in trigger:
                executor.submit(r.reading, t)
1067811
public function handleError()
    {
        if (!$this->shutdownHandlerActive) {
            return;
        }

        $error = error_get_last();

        if ($error['type'] === E_ERROR) {
            $message = sprintf('Error: "%s" in %s on %s', $error['message'], $error['file'], $error['line']);
            $this->task->markError();
            $this->task->addOutput($message);
            $this->logger->error($message);
        }

        // Ensure to release the lock.
        $this->releaseLock();
    }
749120
def handling_exceptions(self):
        """"""
        try:
            if self.using_jobs:
                with handling_broken_process_pool():
                    yield
            else:
                yield
        except SystemExit as err:
            self.register_error(err.code)
        except BaseException as err:
            if isinstance(err, CoconutException):
                logger.display_exc()
            elif not isinstance(err, KeyboardInterrupt):
                traceback.print_exc()
                printerr(report_this_text)
            self.register_error(errmsg=err.__class__.__name__)
232825
private void handleCleanReuse() throws ResourceException {

        // moved clearing the cache to before we issue the reuse connection

        //Now since a reuse was issued, the connection is restored to its orginal properties, so make sure
        // that you match the cri.
        try {
            currentTransactionIsolation = sqlConn.getTransactionIsolation();
            currentHoldability = defaultHoldability;
            //       get the autoCommit value as it will be reset when reusing the connection
            currentAutoCommit = sqlConn.getAutoCommit();
        } catch (SQLException sqlX) {
            FFDCFilter.processException(sqlX, getClass().getName() + ".handleCleanReuse", "2787", this);
            throw AdapterUtil.translateSQLException(sqlX, this, true, getClass());
        }
        // start: turn out that tracing will be reset once the connection is reused.
        // so will need to reset it on our end too and then enable it if needed.
        loggingEnabled = false; // reset the tracing flag for this mc.
        if (helper.shouldTraceBeEnabled(this)) {
            helper.enableJdbcLogging(this);
        }
    }
1141037
def _cleanup(self):
        """"""
        if self._cursor:
            LOGGER.debug('Closing the cursor on %s', self.pid)
            self._cursor.close()
            self._cursor = None

        if self._conn:
            LOGGER.debug('Freeing %s in the pool', self.pid)
            try:
                pool.PoolManager.instance().free(self.pid, self._conn)
            except pool.ConnectionNotFoundError:
                pass
            self._conn = None
345700
private void handleResponseError(long requestId, Throwable error) {
    ContextualFuture future = futures.remove(requestId);
    if (future != null) {
      future.context.execute(() -> future.completeExceptionally(error));
    }
  }
1281151
def handle_error(self):
        """"""
        if self.server.can_ignore_error(self):
            return
        if thread_local.status_code is None:
            msg("ERROR: Cannot send error status code! " +
                "Header already sent!\n{0}", traceback.format_exc())
        else:
            msg("ERROR: Error while processing request:\n{0}",
                traceback.format_exc())
            try:
                self.send_error(500, "Internal Error")
            except:  # nopep8
                if self.server.can_ignore_error(self):
                    return
                msg("ERROR: Cannot send error status code:\n{0}",
                    traceback.format_exc())
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)
568294
def handle_error(self, exc=None):
    """"""
    if exc:
      NailgunProtocol.send_stderr(self.request, traceback.format_exc())
    failure_code = 1
    NailgunProtocol.send_exit_with_code(self.request, failure_code)
2113
void cleanup() throws IOException {
    serverSocket.close();
    try {
      downlink.close();
    } catch (InterruptedException ie) {
      Thread.currentThread().interrupt();
    }      
  }
1214391
def handleConnectionState(self, msg):
        """"""
        self.connected = not (msg.typeName == "error" and
                              msg.errorCode in dataTypes["DISCONNECT_ERROR_CODES"])

        if self.connected:
            self.connection_tracking["errors"] = []
            self.connection_tracking["disconnected"] = False

            if msg.typeName == dataTypes["MSG_CURRENT_TIME"] and not self.connection_tracking["connected"]:
                self.log.info("[CONNECTION TO IB ESTABLISHED]")
                self.connection_tracking["connected"] = True
                self.ibCallback(caller="handleConnectionOpened", msg="<connectionOpened>")
        else:
            self.connection_tracking["connected"] = False

            if not self.connection_tracking["disconnected"]:
                self.connection_tracking["disconnected"] = True
                self.log.info("[CONNECTION TO IB LOST]")
703535
protected void handleAppendResponseFailure(RaftMemberContext member, AppendRequest request, Throwable error) {
    // Log the failed attempt to contact the member.
    failAttempt(member, request, error);
  }
1154213
def _call_connection_lost_and_clean_up(self, exc):
        

        self._state = _State.CLOSED
        try:
            self._protocol.connection_lost(exc)
        finally:
            self._rawsock.close()
            if self._tls_conn is not None:
                self._tls_conn.set_app_data(None)
                self._tls_conn = None
            self._rawsock = None
            self._protocol = None
            self._loop = None