Runs all registered pre commit hooks on the EDBCommit object. Logs exceptions which occurs in the hooks, except
for ServiceUnavailableExceptions and EDBExceptions. If an EDBException occurs, the function returns this
exception.
176314
private EDBException runPreCommitHooks(EDBCommit commit) {
        EDBException exception = null;
        for (EDBPreCommitHook hook : preCommitHooks) {
            try {
                hook.onPreCommit(commit);
            } catch (ServiceUnavailableException e) {
                // Ignore
            } catch (EDBException e) {
                exception = e;
                break;
            } catch (Exception e) {
                logger.error("Error while performing EDBPreCommitHook", e);
            }
        }
        return exception;
    }
448026
private void runEKBErrorHooks(EKBCommit commit, EKBException exception) {
        if (exception != null) {
            for (EKBErrorHook hook : errorHooks) {
                hook.onError(commit, exception);
            }
            throw exception;
        }
    }
90253
def _exception_free_callback(self, callback, *args, **kwargs):
        
        try:
            return callback(*args, **kwargs)
        except Exception:
            self._logger.exception("An exception occurred while calling a hook! ",exc_info=True)
            return None
408784
protected Long performCommitLogic(EDBCommit commit) throws EDBException {
        if (!(commit instanceof JPACommit)) {
            throw new EDBException("The given commit type is not supported.");
        }
        if (commit.isCommitted()) {
            throw new EDBException("EDBCommit is already commitet.");
        }
        if (revisionCheckEnabled && commit.getParentRevisionNumber() != null
                && !commit.getParentRevisionNumber().equals(getCurrentRevisionNumber())) {
            throw new EDBException("EDBCommit do not have the correct head revision number.");
        }
        runBeginCommitHooks(commit);
        EDBException exception = runPreCommitHooks(commit);
        if (exception != null) {
            return runErrorHooks(commit, exception);
        }
        Long timestamp = performCommit((JPACommit) commit);
        runEDBPostHooks(commit);

        return timestamp;
    }
522927
public function toBeOK()
    {
        if (!is_string($this->_actual)) {
            throw new Exception("Error `toBeOK()` need to be applied on a fully-namespaced class or function name.");
        }
        if ($this->_isClass) {
            Monkey::patch($this->_actual, Double::classname());
        } else {
            Monkey::patch($this->_actual, function () {
            });
        }
    }
32001
@Override
    public void commit() throws SQLException
    {
        checkClosed();
        if (props.getProperty(COMMIT_THROW_EXCEPTION, "true").equalsIgnoreCase("true")) {
            throw SQLError.noSupport();
        }
    }
1083137
def process_exception(self, request, exception):
        
        if hasattr(threadlocal, 'actionslog'):
            pre_save.disconnect(sender=LogAction, dispatch_uid=threadlocal.actionslog['signal_duid'])

        return None
785067
protected void threadBegin() {
        //
        // Note the 'beforeCallbacks' list is not going to have a well-defined order, so it is of limited use.
        // We probably want to revisit this with some kind of priority/order based on ranking to make
        // it more useful.
        //
        // At the moment we treat the setting of the tran timeout separately, rather than as a IJobExecutionStartCallbackService,
        // to reflect the fact that this is provided by a required dependency.  If we were to want this to function in SE mode,
        // say, we might want to factor this too as an "extension" that is provided by another layer, and so incorporate this into a
        // more generic, extensible "before" processing.
        try {
            tranMgr.setTransactionTimeout(0);
            if (beforeCallbacks != null) {
                for (IJobExecutionStartCallbackService callback : beforeCallbacks) {
                    if (logger.isLoggable(Level.FINER)) {
                        logger.logp(Level.FINER, CLASSNAME, "threadBegin", "Calling before callback", callback);
                    }
                    callback.jobStarted(runtimeWorkUnitExecution);
                }
            }
        } catch (Throwable t) {
            // Fail the execution if any of our before-work-unit callbacks failed. E.g. the joblog context setup
            // was unsuccessful. We may want to make it an option whether or not to fail here in the future.
            runtimeWorkUnitExecution.logExecutionFailedMessage();
            throw new BatchContainerRuntimeException("An error occurred during thread initialization.", t);
        }
    }
164319
private void processUncaughtException(Thread thread, Throwable throwable) {
        if (exceptionPurger != null) {
            throwable = exceptionPurger.purge(throwable);
        }
        logException(thread, throwable);
        notifyUserAboutException(thread, throwable);
    }
1367127
private boolean rollbackIfNecessary(
      Transactional transactional, Exception e, EntityTransaction txn) {
    boolean commit = true;

    //check rollback clauses
    for (Class<? extends Exception> rollBackOn : transactional.rollbackOn()) {

      //if one matched, try to perform a rollback
      if (rollBackOn.isInstance(e)) {
        commit = false;

        //check ignore clauses (supercedes rollback clause)
        for (Class<? extends Exception> exceptOn : transactional.ignore()) {
          //An exception to the rollback clause was found, DON'T rollback
          // (i.e. commit and throw anyway)
          if (exceptOn.isInstance(e)) {
            commit = true;
            break;
          }
        }

        //rollback only if nothing matched the ignore check
        if (!commit) {
          txn.rollback();
        }
        //otherwise continue to commit

        break;
      }
    }

    return commit;
  }
1305775
public void commit() throws SQLException {
        if (useConnection == null) {
            LOG.info("Commit operation not supported when using datasets unless using withTransaction or cacheConnection - attempt to commit ignored");
            return;
        }
        try {
            useConnection.commit();
        } catch (SQLException e) {
            LOG.warning("Caught exception committing connection: " + e.getMessage());
            throw e;
        }
    }
474803
@AfterThrowing(pointcut = "execution( * org.eclipse.hawkbit.repository.jpa.*Management.*(..))", throwing = "ex")
    // Exception for squid:S00112, squid:S1162
    // It is a AspectJ proxy which deals with exceptions.
    @SuppressWarnings({ "squid:S00112", "squid:S1162" })
    public void catchAndWrapJpaExceptionsService(final Exception ex) throws Throwable {

        // Workarround for EclipseLink merge where it does not throw
        // ConstraintViolationException directly in case of existing entity
        // update
        if (ex instanceof TransactionSystemException) {
            throw replaceWithCauseIfConstraintViolationException((TransactionSystemException) ex);
        }

        for (final Class<?> mappedEx : MAPPED_EXCEPTION_ORDER) {

            if (!mappedEx.isAssignableFrom(ex.getClass())) {
                continue;
            }

            if (EXCEPTION_MAPPING.containsKey(mappedEx.getName())) {
                throw (Exception) Class.forName(EXCEPTION_MAPPING.get(mappedEx.getName()))
                        .getConstructor(Throwable.class).newInstance(ex);
            }

            LOG.error("there is no mapping configured for exception class {}", mappedEx.getName());
            throw new GenericSpServerException(ex);
        }

        throw ex;
    }
671348
def run(self):
        
        error = None
        # run 'pre_run', 'logging', 'dependencies' and 'run'
        try:  # serve as a central place for error logging
            self._logging(self.parsed_args)
            if 'deps_only' not in self.parsed_args:
                self._run_path_run('pre', self.parsed_args)
            self._run_path_dependencies(self.parsed_args)
            if 'deps_only' not in self.parsed_args:
                self._run_path_run('', self.parsed_args)
        except exceptions.ExecutionException as e:
            error = self._log_if_not_logged(e)
            if isinstance(e, exceptions.YamlError):  # if there's a yaml error, just shut down
                raise e

        # in any case, run post_run
        try:  # serve as a central place for error logging
            self._run_path_run('post', self.parsed_args)
        except exceptions.ExecutionException as e:
            error = self._log_if_not_logged(e)

        # exitfuncs are run all regardless of exceptions; if there is an exception in one
        #  of them, this function will raise it at the end
        try:
            utils.run_exitfuncs()
        except exceptions.ExecutionException as e:
            error = self._log_if_not_logged(e)

        if error:
            raise error
558984
public void commit() throws DBException, RemoteException
    {
        BaseTransport transport = this.createProxyTransport(COMMIT);
        Object strReturn = transport.sendMessageAndGetReply();
        Object objReturn = transport.convertReturnObject(strReturn);
        this.checkDBException(objReturn);
    }
463022
private void runEKBPostCommitHooks(EKBCommit commit) throws EKBException {
        for (EKBPostCommitHook hook : postCommitHooks) {
            try {
                hook.onPostCommit(commit);
            } catch (Exception e) {
                LOGGER.warn("An exception is thrown in a EKB post commit hook.", e);
            }
        }
    }
49217
protected <E extends Throwable, V extends ATSecDBValidator> Set<ATError> handleException(E e, Log logger, V validator, 
			String key, String suffix, String defaultMessagePrefix) {
		return handleException(e, logger, validator, key, suffix, defaultMessagePrefix, new Object[] {});
	}
384193
private static void attemptRetryOnException(String logPrefix, Request<?> request,
                                                JusError exception) throws JusError {
        RetryPolicy retryPolicy = request.getRetryPolicy();

        if (retryPolicy == null) {
            throw exception;
        }

        try {
            retryPolicy.retry(exception);
        } catch (JusError e) {
            request.addMarker(Request.EVENT_NETWORK_RETRY_FAILED,
                    String.format("%s-timeout-giveup [conn-timeout=%s] [read-timeout=%s]",
                            logPrefix, retryPolicy.getCurrentConnectTimeout(),
                            retryPolicy.getCurrentReadTimeout()));
            throw e;
        }
        request.addMarker(Request.EVENT_NETWORK_RETRY,
                String.format("%s-retry [conn-timeout=%s] [read-timeout=%s]",
                        logPrefix, retryPolicy.getCurrentConnectTimeout(),
                        retryPolicy.getCurrentReadTimeout()));
    }