In this implementation we log each exception and rethrow.

@param ProceedingJoinPointInterface $jointPoint
@throws \Exception
@return mixed
766908
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) {
        try {
            return $jointPoint->proceed();
        } catch (Exception $e) {
            $methodName = $jointPoint->getMethodName();
            $partialTrace = array();
            $trace = $e->getTrace();
            $depth = 0;
            foreach ($trace as $entry) {
                if ($depth > $this->maxTraceDepth) {
                    $partialTrace[] = "... trace truncated";
                    break;
                }
                $file = isset($entry['file']) ? $entry['file'] : "";
                $function = isset($entry['function']) ? $entry['function'] : "";
                $line = isset($entry['line']) ? $entry['line'] : "";

                $partialTrace[] = sprintf("%s:%s:%s", $file, $function, $line);
                $depth++;
            }

            $msg = sprintf("Exception in %s:%s:%s (%d) %s", $e->getFile(), $e->getLine(), $methodName, $e->getCode(), $e->getMessage());
            $this->logger->logWarning($msg, implode("\n", $partialTrace));
            throw $e;
        }
    }
151607
@Around("execute() || testing()")
  public Object trace(ProceedingJoinPoint call) throws Throwable {
    if (call.getArgs().length == 0 || call.getArgs()[0] == null) {
      return call.proceed();
    }

    String sql = (String) call.getArgs()[0];
    String spanName = makeSpanName(call, sql);

    return Handler.proceed(call, tracer, spanName, sql);
  }
1330608
public function invoke(JoinPointInterface $joinPoint)
    {
        if ($this->runtimeEvaluator !== null && $this->runtimeEvaluator->__invoke($joinPoint, $this->objectManager) === false) {
            return $joinPoint->getAdviceChain()->proceed($joinPoint);
        }

        $adviceObject = $this->objectManager->get($this->aspectObjectName);
        $methodName = $this->adviceMethodName;
        return $adviceObject->$methodName($joinPoint);
    }
785392
protected function exception(ConnectionInterface $connection, ErrorResponseInterface $response)
    {
        $connection->disconnect();
        $message = $response->getMessage();

        throw new ServerException($message);
    }
65797
public function addRecordStartedEvent(JoinPointInterface $joinPoint)
    {
        $data = $joinPoint->getMethodArgument('data');
        $externalIdentifier = Arrays::getValueByPath($data, '__externalIdentifier');
        $title = Arrays::getValueByPath($data, '__label');
        /** @var ImporterInterface $importer */
        $importer = $joinPoint->getProxy();
        list($importerClassName) = $this->getImporterClassNames($importer);

        $data['__message'] = sprintf('%s: "%s" (%s)', $importerClassName, $title ?: '-- No label --', $externalIdentifier);
        $event = $importer->getImportService()->addEvent(sprintf('%s:Record:Started', $importerClassName), $externalIdentifier, $data);
        $importer->setCurrentEvent($event);
    }
1099870
public function logDestroy(JoinPointInterface $joinPoint)
    {
        $session = $joinPoint->getProxy();
        if ($session->isStarted()) {
            $reason = $joinPoint->isMethodArgument('reason') ? $joinPoint->getMethodArgument('reason') : 'no reason given';
            $this->logger->debug(sprintf('%s: Destroyed session with id %s: %s', $this->getClassName($joinPoint), $joinPoint->getProxy()->getId(), $reason));
        }
    }
1189793
public function handleException(ServerRequestInterface $request, ResponseInterface $response, Exception $exception)
    {
        return $this->withError($response, $exception);
    }
1145074
@AfterThrowing(pointcut = "execution(* org.apache.cassandra.thrift.CassandraServer.doInsert(..))", throwing = "throwable")
    public void logErrorFromThrownException(final JoinPoint joinPoint, final Throwable throwable) {
        final String className = joinPoint.getTarget().getClass().getName();
        final String methodName = joinPoint.getSignature().getName();

        logger.error("Could not write to cassandra! Method: " + className + "."+ methodName + "()", throwable);
    }
1003999
public function process($connection, Job $job, $maxTries = 0, $delay = 0)
	{
		if ($maxTries > 0 && $job->attempts() > $maxTries)
		{
			return $this->logFailedJob($connection, $job);
		}

		try
		{
			// First we will fire off the job. Once it is done we will see if it will
			// be auto-deleted after processing and if so we will go ahead and run
			// the delete method on the job. Otherwise we will just keep moving.
			$job->fire();

			return ['job' => $job, 'failed' => false];
		}

		catch (Exception $e)
		{
			// If we catch an exception, we will attempt to release the job back onto
			// the queue so it is not lost. This will let is be retried at a later
			// time by another listener (or the same one). We will do that here.
			if ( ! $job->isDeleted()) $job->release($delay);

			throw $e;
		}
	}
776120
private Object handleJoinPointCompletableFuture(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.bulkhead.Bulkhead bulkhead) {
		return bulkhead.executeCompletionStage(() -> {
			try {
				return (CompletionStage<?>) proceedingJoinPoint.proceed();
			} catch (Throwable throwable) {
				throw new CompletionException(throwable);
			}
		});
	}
664208
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $this->logger = $this->createLogger($input, $output);
        $error = null;
        try {
            $result = $this->executeWithLogger($input);
        } catch (Exception $x) {
            $error = $x;
        } catch (Throwable $x) {
            $error = $x;
        }
        if ($error !== null) {
            $this->logger->error($this->formatThrowable($error));

            return static::RETURN_CODE_ON_FAILURE;
        }

        return $result;
    }
8288
private function createSnapshot(string $endpoint, ?string $where = null, $strictMode = false): void
    {
        if ($this->endpoints && !\in_array($endpoint, $this->endpoints)) {
            if (DefinitionRegistry::DEFAULT_ENDPOINT === $endpoint) {
                throw new \Exception('Must specify a valid endpoint name or use the `--all` option');
            }

            throw new \Exception(
                sprintf('The are no valid endpoint called `%s`.', $endpoint)
            );
        }

        $snapshot = $this->schemaSnapshot->createSnapshot($endpoint);
        file_put_contents(sprintf('%s/%s.snapshot.json', $where, $endpoint), json_encode($snapshot, JSON_PRETTY_PRINT));
        $this->updateFeatureFile($where, $endpoint, $strictMode);
    }
722507
private function shareExceptionTrace(ResponseInterface $response): void
    {
        foreach ($response->getExceptions() as $exception) {
            if ($exception instanceof GraphQLExceptionInterface) {
                $exception->withExtension(new ExceptionTraceExtension($exception));
            }

            $exception->publish();
        }
    }
183063
public function handleThrowable(ServerRequestInterface $request, ResponseInterface $response, Throwable $throwable)
    {
        return $this
            ->getContentTypeHandler($request)
            ->handleThrowable($request, $response, $throwable);
    }
948505
protected function onInterruptionByException(ExtensionInterface $extension, Context $context)
    {
        $logger = $context->getLogger();

        $exception = $context->getException();
        $logger->error(
            sprintf('Consuming interrupted by exception. "%s"', $exception->getMessage()),
            ['exception' => $exception]
        );

        try {
            $extension->onInterrupted($context);
        } catch (\Exception $e) {
            // logic is similar to one in Symfony's ExceptionListener::onKernelException
            $logger->error(sprintf(
                'Exception thrown when handling an exception (%s: %s at %s line %s)',
                get_class($e),
                $e->getMessage(),
                $e->getFile(),
                $e->getLine()
            ));

            $wrapper = $e;
            while ($prev = $wrapper->getPrevious()) {
                if ($exception === $wrapper = $prev) {
                    throw $e;
                }
            }

            $prev = new \ReflectionProperty('Exception', 'previous');
            $prev->setAccessible(true);
            $prev->setValue($wrapper, $exception);

            throw $e;
        }

        throw $exception;
    }
111748
public function transactionRollback($toSavepoint = false)
	{
		if (!$toSavepoint || $this->transactionDepth <= 1)
		{
			$this->connect();

			if ($this->connection->rollback())
			{
				$this->transactionDepth = 0;
			}

			return;
		}

		$savepoint = 'SP_' . ($this->transactionDepth - 1);

		if ($this->executeUnpreparedQuery('ROLLBACK TO SAVEPOINT ' . $this->quoteName($savepoint)))
		{
			$this->transactionDepth--;
		}
	}
446332
@Around(value = "execution(* *.*(..)) && @within(monitor) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)")
    public Object doProfilingClass(ProceedingJoinPoint pjp, Monitor monitor) throws Throwable {
        return doProfiling(pjp, monitor.producerId(), monitor.subsystem(), monitor.category());
    }