Stores the last received error from the server and dispatches the error callback.
19983
def _process_err(self, err=None):
        
        self.stats['errors_received'] += 1

        if err == "'Authorization Violation'":
            self._err = ErrAuthorization
        elif err == "'Slow Consumer'":
            self._err = ErrSlowConsumer
        elif err == "'Stale Connection'":
            self._err = ErrStaleConnection
        else:
            self._err = Exception(err)

        if self._error_cb is not None:
            self._error_cb(err)
120094
function onConnectionError(err) {
        var codeName = errors.classify(err);

        var loggerInfo = conn.extendLogInfo({
            error: err
        });

        if (codeName === 'Timeout' ||
            codeName === 'NetworkError') {
            self.logger.warn('Got a connection error', loggerInfo);
        } else {
            self.logger.error('Got an unexpected connection error', loggerInfo);
        }
        delete self.serverConnections[socketRemoteAddr];
    }
417612
private void serveError(Status status, String error, RequestHandler requestHandler) throws IOException {
    this.serveError(status, HTTPTrackerErrorMessage.craft(error), requestHandler);
  }
533866
function sendErrorResponse(err, callback = undefined, returnData = undefined) {
  let error;
  if (err instanceof Error) {
    error = err;
  } else {
    error = new Error(err);
  }

  if (callback) {
    callback(error, returnData);
  } else {
    throw error;
  }
}
1221342
def _store_lasterr(self):
        """"""
        from sys import exc_info
        from traceback import format_exception
        e = exc_info()
        self.lasterr = '\n'.join(format_exception(e[0], e[1], e[2]))
1331597
function emittedError(err) {
	// jshint validthis:true
	// If operation in progress, reject its promise
	const state = getState(this);
	if (state) {
		clearState(this);
		return state.reject(err);
	}

	// Store error to be returned on next call to
	// `.readEntry()`, `.close()` or `.openReadStream()`.
	if (!getError(this)) setError(this, err);
}
914468
def handle_errors(callback, parsed=None, out=sys.stderr):

    """"""

    try:
        if parsed:
            return callback(parsed)
        else:
            return callback()
    except DeploymentError as e:
        traceback.print_exc(file=out)
        print(e, file=out)
        if hasattr(e, 'value') and hasattr(e.value, 'args') and len(e.value.args) > 0 and \
                'open_sftp_client' in e.value.args[0]:
            print('Timeout', file=out)
            return TIMEOUT
        return DEPLOYMENT_ERROR
    except MalformedResponseError as e:
        traceback.print_exc(file=out)
        print(e, file=out)
        if 'Service Unavailable' in e.body:
            return SERVICE_UNAVAILABLE
        return MALFORMED_RESPONSE
    except SystemExit:
        pass
    except:
        traceback.print_exc(file=out)
        return EXCEPTION
801737
public function errorAtShutdown()
    {
        $error = error_get_last();
        if (isset($error)) {
            $this->onAnyException(new \ErrorException($error['message'], $error['type'], 1, $error['file'], $error['line']));
        }
    }
600568
protected function lastErrorWasFatal()
    {
        if ($this->lastException) {
            return true;
        }
        $error = error_get_last();
        return $error && ($error['type'] & self::$fatal_errors) != 0;
    }
1310202
def error_handler(self, error):
        
        warnings.warn(
            """
            error_handler is deprecated.
            Use FlaskBuzz.build_error_handler instead
            """,
            warnings.DeprecationWarning,
        )
        return error.jsonify(), error.status_code, error.headers
172488
protected function registerErrorHandling()
    {
        mysqli_report(MYSQLI_REPORT_STRICT);
        
        set_error_handler(function ($level, $message, $file = '', $line = 0) {
            if (error_reporting() & $level) {
                throw new ErrorException($message, 0, $level, $file, $line);
            }
        });
        
        set_exception_handler(function ($e) {
            $this->handleUncaughtException($e);
        });
        
        register_shutdown_function(function () {
            if (! is_null($error = error_get_last()) && $this->isFatalError($error['type'])) {
                $this->handleUncaughtException(new FatalErrorException(
                    $error['message'], $error['type'], 0, $error['file'], $error['line']
                ));
            }
        });
    }
766821
public static function checkLastError()
    {
        $error = json_last_error();

        if ($error == JSON_ERROR_NONE) {
            return;
        }

        $message = json_last_error_msg();

        throw new JsonException("JSON Error: " . $message, $error);
    }
1326945
def dispatch_error(self, err):
        '''
        
        '''
        try:
            data = {'error': [l for l in err.args]}
            body = self._meta.formatter.format(data)
        except Exception as ex:
            data = {'error': str(err)}
            body = self._meta.formatter.format(data)

        status = getattr(err, 'status', 500)
        return self.build_http_response(body, status=status)
113497
function processError (error) {
    if (_cb.beforeReturnError) { _cb.beforeReturnError(error); }
    if (_cb.returnError) { _cb.returnError(error, response); }
    if (_cb.afterReturnError) { _cb.afterReturnError(error); }
  }
699915
def __error_callback(self, exception, interval):
        
        logging.error('Error while publishing {}'.format(
            exception))
        logging.info('Retry in %s seconds.', interval)
326191
def handle_error(self, error=None):
        """"""
        if _debug: TCPServer._debug("handle_error %r", error)

        # core does not take parameters
        asyncore.dispatcher.handle_error(self)
142267
public function handleShutdown()
    {
        if (! is_null($error = error_get_last()) && $this->isFatal($error['type'])) {
            $exception = new ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']);
            $this->handleException($exception);
        }
    }