Allocates an error occurred object from an object pool.
167186
private ConversationReceiveListenerErrorOccurredInvocation allocateErrorOccurredInvocation(Connection connection,
                                                                   ConversationReceiveListener listener,
                                                                   SIConnectionLostException exception,
                                                                   int segmentType,
                                                                   int requestNumber,
                                                                   int priority,
                                                                   Conversation conversation)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "allocateErrorOccurredInvocation", new Object[] {connection, listener, exception, ""+segmentType, ""+requestNumber, ""+priority, conversation});
      ConversationReceiveListenerErrorOccurredInvocation retInvocation = (ConversationReceiveListenerErrorOccurredInvocation)conversationReceiveListenerErrorOccurredInvocationPool.remove();
      if (retInvocation == null)
      {
         retInvocation = new ConversationReceiveListenerErrorOccurredInvocation(connection,
                                                                                listener,
                                                                                exception,
                                                                                segmentType,
                                                                                requestNumber,
                                                                                priority,
                                                                                conversation,
                                                                                conversationReceiveListenerErrorOccurredInvocationPool);
      }
      else
      {
         retInvocation.reset(connection,
                             listener,
                             exception,
                             segmentType,
                             requestNumber,
                             priority,
                             conversation);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "allocateDataReceivedInvocation", retInvocation);
      return retInvocation;
   }
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
628405
private static void initExceptionThreadPool() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initExceptionThreadPool");

        // Do a synchronous check to ensure once-only creation
        synchronized (exceptionTPCreateSync) {
            if (exceptionThreadPool == null) {
                // Get the maximum size for the thread pool, defaulting if
                // not specified or if the value cannot be parsed
                int maxThreads = Integer.parseInt(ApiJmsConstants.EXCEPTION_MAXTHREADS_DEFAULT_INT);
                String maxThreadsStr = RuntimeInfo.getProperty(ApiJmsConstants.EXCEPTION_MAXTHREADS_NAME_INT,
                                                               ApiJmsConstants.EXCEPTION_MAXTHREADS_DEFAULT_INT);
                try {
                    maxThreads = Integer.parseInt(maxThreadsStr);
                } catch (NumberFormatException e) {
                    // No FFDC code needed, but we will exception this
                    SibTr.exception(tc, e);
                }

                // Trace the value we will use
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(tc, ApiJmsConstants.EXCEPTION_MAXTHREADS_NAME_INT + ": " + Integer.toString(maxThreads));

                // Create the thread pool
                exceptionThreadPool = new ThreadPool(ApiJmsConstants.EXCEPTION_THREADPOOL_NAME_INT, 0, maxThreads);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initExceptionThreadPool");
    }
1275249
def add_codes(err_cls):
    """"""
    class ErrorsWithCodes(object):
        def __getattribute__(self, code):
            msg = getattr(err_cls, code)
            return '[{code}] {msg}'.format(code=code, msg=msg)
    return ErrorsWithCodes()
929303
def from_exception(cls, exception, retain_exc_info=True,
                       cause=None, find_cause=True):
        """"""
        exc_info = (
            type(exception),
            exception,
            getattr(exception, '__traceback__', None)
        )
        return cls.from_exc_info(exc_info=exc_info,
                                 retain_exc_info=retain_exc_info,
                                 cause=cause, find_cause=find_cause)
453231
protected final <V> void error(Throwable t, SettableFuture<V> future) {
    state.set(State.ERROR);
    if (future != null) {
      future.setException(t);
    }
    caller.error(t);
  }
1315469
def on_error(self, ex):
        
        if self._d:
            self._d.errback()
            self._d = None
1126965
def _loadError(ErrorType, thrownError, tracebackString):
    ''''''
    RemoteException = asRemoteException(ErrorType)
    return RemoteException(thrownError, tracebackString)
365137
public Token allocate(ManagedObject objectToStore)
                    throws ObjectManagerException
    {

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "allocate",
                        objectToStore);

        // We cannot store null, it won't serialize and we have no way to manage the transaction state.
        if (objectToStore == null) {
            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "allocate",
                           objectToStore);
            throw new InvalidObjectToStoreException(this,
                                                    objectToStore);
        } // If asked to store null.

        // Is the store full?
        if (!allocationAllowed) {
            // request or wait for a checkpoint and see if that helps
            if (getStoreFullWaitForCheckPoint())
            {
                if (trace.isDebugEnabled())
                    trace.debug(this, cclass, "allocate", "Store is currently full, waiting for checkpoint");
                objectManagerState.waitForCheckpoint(true);
            }
            else
            {
                if (trace.isDebugEnabled())
                    trace.debug(this, cclass, "allocate", "Store is currently full, requesting checkpoint");
                objectManagerState.requestCheckpoint(true);
            }

            if (!allocationAllowed)
            {
                if (trace.isEntryEnabled())
                    trace.exit(this, cclass
                               , "allocate"
                                    );

                throw new ObjectStoreFullException(this
                                                   , objectToStore);
            }
        } // If (!allocationAllowed). 

        Token tokenToStore;
        long usableSequenceNumber;

        synchronized (sequenceNumberLock) {
            // Establish the sequence number we will use. 
            usableSequenceNumber = ++sequenceNumber;
        } // synchronized (sequenceNumberLock).

        // Create the container for the object.    
        tokenToStore = new Token(objectToStore, this, usableSequenceNumber);

        // Keep a note of the in memory copy of the object so that we give back the same one
        // whenever it is asked for.
        // If the application never adds the object, we would clean this up when its reference to the Object
        // is lost. 
        Token inMemoryToken = (Token) inMemoryTokens.putIfAbsent(new Long(usableSequenceNumber),
                                                                 tokenToStore);

        // Check that this genuinely a new storedObjectIdentifier.
        if (inMemoryToken != null) {
            if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                trace.debug(this,
                            cclass,
                            "allocate",
                            new Object[] { "via StoreSequenceException",
                                          inMemoryToken,
                                          new Long(sequenceNumber) });
            StoreSequenceException storeSequenceException = new StoreSequenceException(this,
                                                                                       sequenceNumber,
                                                                                       inMemoryToken);
            ObjectManager.ffdc.processException(this,
                                                cclass,
                                                "add",
                                                storeSequenceException,
                                                "1:402:1.31");
            if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                trace.exit(this,
                           cclass,
                           "allocate",
                           storeSequenceException);
            throw storeSequenceException;
        } // if (inMemoryToken != null).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "allocate"
                       , new Object[] { tokenToStore }
                            );
        return tokenToStore;
    }
872468
Allocation allocate(Mutation mutation, int size)
    {
        final OpOrder.Group opGroup = appendOrder.start();
        try
        {
            int position = allocate(size);
            if (position < 0)
            {
                opGroup.close();
                return null;
            }
            markDirty(mutation, position);
            return new Allocation(this, opGroup, position, (ByteBuffer) buffer.duplicate().position(position).limit(position + size));
        }
        catch (Throwable t)
        {
            opGroup.close();
            throw t;
        }
    }
1057584
function modelIndexErrors(errors, context) {
        if (context && context.modelIndexErrors) {
            return context.modelIndexErrors(errors);
        }
        if (Array.isArray(errors)) {
            var rtn = {};
            _.each(errors, function(data) {
                for (var name in data) {
                    if (data.hasOwnProperty(name)) {
                        rtn[name] = data[name];
                    }
                }
            });
            return rtn;
        } else {
            return errors;
        }
    }
1063280
def _subtask_error(self, idx, error):
        """"""
        self.set_exception(error)
        self.errbacks.clear()
43322
public void errorCommon(String msgCode, Object[] objects) {
        if (!bInboundSupported) {
            Tr.error(tcCommon, msgCode, objects);
        }
    }
1003396
function StoreError(type, message) {
  this.name = StoreError.name;
  Error.call(this);
  type = type || ERR;
  message = type + ' ' + (message || 'unknown internal error');
  if(arguments.length > 2) {
    var args = [message].concat([].slice.call(arguments, 2));
    message = util.format.apply(util, args);
  }
  this.message = message;
}
247181
private void handleGenericHNIError(Throwable t, HttpInboundServiceContextImpl hisc) {
        hisc.setHeadersParsed();
        sendErrorMessage(t);
        setPartiallyParsed(false);
    }
193217
function normalizeError(err,pools){
    if (!(err instanceof Error)){
        err = new Error(err)
    }
    if (!err._isException){

        //Iterate over exceptionPools finding error match
        for(let i=0;i<pools.length;i++){
            let exception = pools[i]._convert(err)
            if (exception) return exception
        }
    }
    return err
}
326210
def raise_error(error):
    
    exc_type = error.get('exc_type')
    if exc_type and exc_type.startswith(ERROR_PREFIX):
        exc_type = exc_type[len(ERROR_PREFIX):]
        exc_cls = ERROR_TYPE_MAP.get(exc_type, DashiError)
    else:
        exc_cls = DashiError

    raise exc_cls(**error)