Called when a backend (or other framework code) encounters an exception that it can recover
from, but which it would like to report in some orderly fashion. <em>NOTE:</em> this method
may be called from threads other than the main PlayN thread.
185495
public void reportError (String message, Throwable cause) {
    errors.emit(new Error(message, cause));
    log().warn(message, cause);
  }
648792
def Exception(obj, eng, callbacks, exc_info):
        """"""
        exception_repr = ''.join(traceback.format_exception(*exc_info))
        msg = "Error:\n%s" % (exception_repr)
        eng.log.error(msg)
        if obj:
            # Sets an error message as a tuple (title, details)
            obj.extra_data['_error_msg'] = exception_repr
            obj.save(
                status=obj.known_statuses.ERROR,
                callback_pos=eng.state.callback_pos,
                id_workflow=eng.uuid
            )
        eng.save(WorkflowStatus.ERROR)
        db.session.commit()

        # Call super which will reraise
        super(InvenioTransitionAction, InvenioTransitionAction).Exception(
            obj, eng, callbacks, exc_info
        )
164319
private void processUncaughtException(Thread thread, Throwable throwable) {
        if (exceptionPurger != null) {
            throwable = exceptionPurger.purge(throwable);
        }
        logException(thread, throwable);
        notifyUserAboutException(thread, throwable);
    }
215163
public static void showException(Throwable throwable) {
		throwable.printStackTrace(getSystemErrorStream());
		JOptionPane.showMessageDialog(null, throwable.toString(),
				UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE);
		// on pourrait affichage une boîte de dialogue plus évoluée pour permettre d'afficher la stack trace en détail
	}
106578
private void reportException(int s) {
        Throwable ex = ((s == CANCELLED) ?  new CancellationException() :
                        (s == EXCEPTIONAL) ? getThrowableException() :
                        null);
        if (ex != null)
            U.throwException(ex);
    }
838777
private void rethrowOrSwallowIfBackup(CacheNotExistsException e) throws Exception {
        if (this instanceof BackupOperation) {
            getLogger().finest("Error while getting a cache", e);
        } else {
            throw ExceptionUtil.rethrow(e, Exception.class);
        }
    }
898287
@Override
    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
        if (!notifiedOnFailure) {
            notifiedOnFailure = true;
            try {
                responseHandler.onFailure(new SdkClientException("Unable to execute HTTP request.", cause));
            } finally {
                ctx.channel().close();
            }
        }
    }
153039
def on_exceptioninfo_request(self, py_db, request):
        '''
        
        '''
        # : :type exception_into_arguments: ExceptionInfoArguments
        exception_into_arguments = request.arguments
        thread_id = exception_into_arguments.threadId
        max_frames = int(self._debug_options['args'].get('maxExceptionStackFrames', 0))
        self.api.request_exception_info_json(py_db, request, thread_id, max_frames)
695538
final void connectionErrorOccurred(final Exception exception, boolean callJCAListener) {

        final String methodName = "connectionErrorOccurred";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, new Object[] {exception, Boolean.valueOf(callJCAListener)});
        }

        /*
         * Only send the event if the server isn't shutting down anyway
         */

        if (!SibRaEngineComponent.isServerStopping()) {

            final ConnectionEvent event = new ConnectionEvent(this,
                    ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);

            // Copy list to protect against concurrent modification by listener
            final List copy;
            synchronized (_eventListeners) {
                copy = new ArrayList(_eventListeners);
            }

            // We will probably want to look into some how figuring out that the listener
            // that we have is the JCA one and not some other one that is registered as we
            // want to call those ones regardless of the flag. Today we only expect JCA listeners
            // to be registered
            if (callJCAListener)
            {
              for (final Iterator iterator = copy.iterator(); iterator.hasNext();) {
                final Object object = iterator.next();
                if (object instanceof ConnectionEventListener) {
                    ((ConnectionEventListener) object)
                            .connectionErrorOccurred(event);
                }
              }
            }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
1256260
@Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        if (getEmbeddedHttp2Exception(cause) != null) {
            // Some exception in the causality chain is an Http2Exception - handle it.
            onError(ctx, false, cause);
        } else {
            super.exceptionCaught(ctx, cause);
        }
    }
694275
public void handleUncaughtErrors(Thread thread) {
    final Rollbar rollbar = this;
    thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
      public void uncaughtException(Thread t, Throwable e) {
        rollbar.log(e, null, null, null, true);
      }
    });
  }
684595
private void postInvokeRolledbackException(EJSDeployedSupport s, CSITransactionRolledbackException ex) throws RemoteException {
        //---------------------------------------------------------------
        // Check to see if the application requested that this transaction
        // be rolled back. If so, we can report no exception so suppress
        // the rollback exception here.
        // Only applies if the beginner bean called setRollbackOnly
        // during the business method.                            d186801
        // Or, if the beginner threw an Application Exception     d199884
        // Except, don't supress for ejbTimeout.                LI2281.07
        //---------------------------------------------------------------

        //d140003.19 d186801
        if ((!s.ivBeginnerSetRollbackOnly &&
             (!s.began ||
              s.exType != ExceptionType.CHECKED_EXCEPTION))
            ||
            s.methodInfo.ivInterface == MethodInterface.TIMED_OBJECT) { //90514;;
                                                                                                                                                                           //d140003.19
            final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
            if (isTraceOn && tc.isEventEnabled())
                Tr.event(tc, "postInvoke: transaction rollback in finally",
                         ex); //93496

            // If an exception occurred during beforeCompletion, then override
            // the cause set by TranStrategy since that one will contain
            // superfluous RuntimeException wrappers.          d109641.1 d616849.2
            if (s.currentTx != null &&
                s.currentTx.ivPostProcessingException != null) {
                // If there was an exception during post processing
                // (commit), then set it as an unchecked exception.
                // This will not override any exception that occurred
                // during the bean method.        PQ90221 d219086 d219086.1
                s.getExceptionMappingStrategy().setUncheckedException(s, s.currentTx.ivPostProcessingException);
                ex.detail = s.getRootCause();
            } else if (ex.detail == null) {
                ex.detail = s.getRootCause();//d140003.19
            }
            //d171654 make sure CSITRBException root cause not overwritten
            else {
                //d174358.1---------->
                Throwable exceptionToUse = s.getRootCause();//d140003.19

                if (exceptionToUse == null) {
                    s.rootEx = s.getExceptionMappingStrategy().findRootCause(ex.detail);
                } else {
                    // we have a checked or unchecked so use that per spec
                    ex.detail = exceptionToUse;
                }
                //<----------d174358.1
            } //<--------d171654

            // Perform standard exception mapping using the exception
            // mapping utilities (just like EJSDeployedSupport). This
            // will wrap the CSI exception in a
            // TransactionRolledBackException, which is the exception
            // required by the EJB spec, then that will be mapped to
            // a CORBA TRANSACTION_ROLLEDBACK exception, as required
            // by the ORB.  The ORB should convert the
            // TRANSACTION_ROLLEDBACK to a TransactionRolledBackException
            // on the client.  Note that the root cause will be lost,
            // but will be embeded as part of the message text.  d109641.1
            Exception crex = s.mapCSITransactionRolledBackException(ex); //d140003.19             // d113344

            // The above result should always be a TRANSACTION_ROLLEDBACK,
            // but this is coded just in case mapException is changed in
            // the future.                                       d109641.1
            if (crex instanceof RemoteException)
                throw (RemoteException) crex;
            else if (crex instanceof RuntimeException)
                throw (RuntimeException) crex;
        }
    }
276464
protected void handleAdapterInvocationError(Throwable errorCause)
        throws ActivityException {
        logger.severeException(getAdapterInvocationErrorMessage(), errorCause);
        boolean isErrorRetryable;
        int errorCode;
        if (errorCause instanceof AdapterException) {
            AdapterException adEx = (AdapterException) errorCause;
            isErrorRetryable = adEx.isRetryable();
            if (adEx.getCode() != 0) {
                errorCode = adEx.getCode();
            }
            else {
                errorCode = ServiceException.INTERNAL_ERROR;
            }
        }
        else if (errorCause instanceof ConnectionException) {
            errorCode = ((ConnectionException)errorCause).getCode();
            // if process is invoked sync style, no need to retry due to connection failure
            Process procVO = getProcessDefinition();
            if (procVO.getProcessType().equals(ProcessVisibilityConstant.SERVICE)) {
                super.setReturnCode("ERROR:");
                return;
            }
            isErrorRetryable = true;
        }
        else {
            errorCode = ServiceException.INTERNAL_ERROR;
            isErrorRetryable = false;
        }

        if (isErrorRetryable) {
            super.setReturnCode(ActivityResultCodeConstant.RESULT_RETRY);
        }

        this.handleAdapterFailure(errorCode, errorCause);
    }
284002
def handle_error(self, error: Exception) -> None:
        
        LOGGER.exception("error during pgn parsing")
        self.game.errors.append(error)
527823
@Override
    public void uncaughtException(Thread thread, Throwable thrown) {
        if (enabled) {
            logger.trace("Uncaught exception received.");

            EventBuilder eventBuilder = new EventBuilder()
                .withMessage(thrown.getMessage())
                .withLevel(Event.Level.FATAL)
                .withSentryInterface(new ExceptionInterface(thrown));

            try {
                Sentry.capture(eventBuilder);
            } catch (Exception e) {
                logger.error("Error sending uncaught exception to Sentry.", e);
            }
        }

        // taken from ThreadGroup#uncaughtException
        if (defaultExceptionHandler != null) {
            // call the original handler
            defaultExceptionHandler.uncaughtException(thread, thrown);
        } else if (!(thrown instanceof ThreadDeath)) {
            // CHECKSTYLE.OFF: RegexpSinglelineJava
            System.err.print("Exception in thread \"" + thread.getName() + "\" ");
            thrown.printStackTrace(System.err);
            // CHECKSTYLE.ON: RegexpSinglelineJava
        }
    }
21141
public void requestFailed (Exception cause)
    {
        _error = cause;
        ResultListener<T> list = _list;
        _list = null;

        list.requestFailed(cause);
    }
485831
protected void handleAsyncCallbackException(ConcurrentAsyncCall call, long before, Throwable cause) {
        // not use second argument here, same reason as logging filter
        final Throwable handled = exceptionTranslator.filterCause(cause);
        logger.error(buildAsyncCallbackExceptionMessage(call, before, handled));
    }