Retrieve the exception that was saved away

@return Exception
359780
@Override
    public Exception getLinkedException() {
        //return (Exception) getCause();
        Throwable t = getCause();
        while (t != null) {
            if (t instanceof Exception) {
                return (Exception) t;
            } else {
                t = t.getCause();
            }
        }
        return null;
    }
1105362
protected static function getFirstException(\Exception $exception)
    {
        if (null !== $exception->getPrevious()) {
            return static::getFirstException($exception->getPrevious());
        }

        return $exception;
    }
588339
public function getHeader()
    {
        if (null == $this->header) {
            $header = $this->getNextDataSet();
            if (null === $header) {
                throw new Exception("Cannot retrieve header");
            }
            $this->setHeader($header);
        }

        return $this->header;
    }
212769
public function getDeletedAtTimestamp(): ?int
    {
        if (!$this->isDeleted()) {
            return null;
        }

	    $timestamp = strtotime($this->getDeletedAt() . 'UTC');

	    if ($timestamp === false) {
		    throw new Exception("Unable to get timestamp from \"{$this->getDeletedAt()}\"");
	    }

	    return $timestamp;
    }
1366960
public function deleteDeferred()
    {
        try {
            if ($this->getRequestMethod() !== \Request::HTTP_DELETE) {
                throw new \common_exception_NotImplemented('Only delete method is accepted to deleting delivery');
            }

            if (!$this->hasRequestParameter('uri')) {
                throw new \common_exception_MissingParameter('uri', $this->getRequestURI());
            }

            $uri = $this->getRequestParameter('uri');
            $delivery  = $this->getResource($uri);

            if (!$delivery->exists()) {
                $this->returnFailure(new \common_exception_NotFound('Delivery has not been found'));
            }

            /** @var QueueDispatcher $queueDispatcher */
            $queueDispatcher = $this->getServiceManager()->get(QueueDispatcher::SERVICE_ID);

            $task = new DeliveryDeleteTask();
            $task->setServiceLocator($this->getServiceLocator());
            $taskParameters = ['deliveryId' => $uri];

            $task = $queueDispatcher->createTask($task, $taskParameters, __('Deleting of "%s"', $delivery->getLabel()), null, true);

            $data = $this->getTaskLogReturnData(
                $task->getId(),
                DeliveryDeleteTask::class
            );
            $this->returnSuccess($data);
        } catch (\Exception $e) {
            $this->returnFailure($e);
        }
    }
397750
public Throwable getOriginalException() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getOriginalException");
        if (tc.isEntryEnabled())
            Tr.exit(tc, "getOriginalException", _originalException);
        return _originalException;
    }
623019
function &exceptions()
    {
        $exceptions = NULL;
        foreach ($this->_classes as $name => $exception) {
            if ($exception->isException()) {
                $exceptions[$name] =& $this->_classes[$name];
            }
        }

        return $exceptions;
    }
958096
def exception(self):
        ''''''
        code, _, message = self.data.partition(' ')
        return self.find(code)(message)
518675
protected function getExceptionName(): string
    {
        $exception = $this->getException();

        if ($exception instanceof Exception) {
            $name = $exception->getName();
        } else {
            $name = $this->getDefaultName();
        }

        if ($code = $this->getExceptionCode()) {
            $name .= " (#$code)";
        }

        return $name;
    }
209569
public function actionClear()
    {
        $cachesInput = func_get_args();

        if (empty($cachesInput)) {
            throw new Exception('You should specify cache components names');
        }

        $caches = $this->findCaches($cachesInput);
        $cachesInfo = [];

        $foundCaches = array_keys($caches);
        $notFoundCaches = array_diff($cachesInput, array_keys($caches));

        if ($notFoundCaches) {
            $this->notifyNotFoundCaches($notFoundCaches);
        }

        if (!$foundCaches) {
            $this->notifyNoCachesFound();
            return ExitCode::OK;
        }

        if (!$this->confirmClear($foundCaches)) {
            return ExitCode::OK;
        }

        foreach ($caches as $name => $class) {
            $cachesInfo[] = [
                'name' => $name,
                'class' => $class,
                'is_flushed' => $this->canBeCleared($class) ? $this->app->get($name)->clear() : false,
            ];
        }

        $this->notifyCleared($cachesInfo);
    }
896310
public static function fromException(\Exception $e)
    {
        if ($e instanceof XsollaWebhookException) {
            return static::fromErrorCode($e->getXsollaErrorCode(), $e->getMessage(), $e->getHttpStatusCode());
        } else {
            return static::fromErrorCode('FATAL_ERROR', $e->getMessage());
        }
    }
741246
protected function _exception() {
        $url = '.' . $this->request->src . '.' . $this->request->controller . '.' . $this->request->action;

        if (in_array($url, $this->config['user']['security']['spam']['config']['exception'])) {
            $this->_exception = true;
        }

        return $this->_exception;
    }
890539
public String getExceptionType()
    {
        String exceptionType = null;
        Throwable rootCause = this;
        
        do{
            Throwable temp = ((ServletException)rootCause).getRootCause();
            if(temp != null) {
                rootCause = temp;
            }
            else{
                break;
            }
        }while (rootCause instanceof ServletException);

        // rootCause must be non-null (it started as "this" and was then NEVER set to null by the loop above
        exceptionType = rootCause.getClass().getName();

        return exceptionType;
    }
836545
static function getTextForException(\Exception $exception) {
		// Now, let's compute the same message, but without the HTML markup for the error log.
		$textTrace = "Message: ".$exception->getMessage()."\n";
		$textTrace .= "File: ".$exception->getFile()."\n";
		$textTrace .= "Line: ".$exception->getLine()."\n";
		$textTrace .= "Stacktrace:\n";
		$textTrace .= self::getTextBackTrace($exception->getTrace());
		return $textTrace;
	}
1070108
protected function getDefaultDecider()
    {
        return function ($retry, $maxAttempts, $result = null, $exception = null) {
            if($retry >= $maxAttempts && ! is_null($exception)) {
                throw  $exception;
            }

            return $retry < $maxAttempts && !is_null($exception);
        };
    }
90599
public function recover()
    {
        if (! class_exists($this->class)) {
            return new RuntimeException($this->message);
        }

        try {
            $reflection = new ReflectionClass($this->class);

            $e = $reflection->newInstanceWithoutConstructor();

            if (! $e instanceof Throwable) {
                throw new RuntimeException("Class [{$this->class}] is not an exception.");
            }

            foreach ($reflection->getProperties() as $property) {
                $name = $property->getName();

                if (isset($this->properties[$name])) {
                    $value = $this->properties[$name];

                    $property->setAccessible(true);

                    $property->setValue($e, $value instanceof Serialization ? $value->recover() : $value);
                }
            }

            return $e;
        } catch (Throwable $ex) {
            return new RuntimeException($this->message);
        }
    }
691719
public final Throwable getException() {
        int s = status & DONE_MASK;
        return ((s >= NORMAL)    ? null :
                (s == CANCELLED) ? new CancellationException() :
                getThrowableException());
    }