Returns an Inspector for a previous Exception, if any.
@todo   Clean this up a bit, cache stuff a bit better.
@return Inspector
8289
public function getPreviousExceptionInspector()
    {
        if ($this->previousExceptionInspector === null) {
            $previousException = $this->exception->getPrevious();

            if ($previousException) {
                $this->previousExceptionInspector = new Inspector($previousException);
            }
        }

        return $this->previousExceptionInspector;
    }
718508
public function beforeException() {
        /**
         * @param \Phalcon\Events\Event $event
         * @param \Phalcon\Dispatcher $dispatcher
         * @param \Exception $exception
         * @return callable
         */
        return function(Event $event, Dispatcher $dispatcher, \Exception $exception) {
            $resolver = new ExceptionResolver();
            $resolver->setDI($dispatcher->getDI());
            $resolver->resolve($exception);

            return false;
        };
    }
743442
@Override
    public ExceptionListener getExceptionListener() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getExceptionListener");

        ExceptionListener exceptionListener = null;

        try {
            exceptionListener = jmsConnection.getExceptionListener();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getExceptionListener", new Object[] { exceptionListener });
        }

        return exceptionListener;
    }
1071132
public H getHelper() {
		if (helper == null) {
			if (!created) {
				throw new IllegalStateException("A call has not been made to onCreate() yet so the helper is null");
			} else if (destroyed) {
				throw new IllegalStateException(
						"A call to onDestroy has already been made and the helper cannot be used after that point");
			} else {
				throw new IllegalStateException("Helper is null for some unknown reason");
			}
		} else {
			return helper;
		}
	}
813005
protected ProblemTreeViewer getViewer() {
		try {
			return (ProblemTreeViewer) this.reflect.get(this, "fViewer"); //$NON-NLS-1$
		} catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
			throw new Error(e);
		}
	}
1179313
public function getControlHandler() {
		if ($this->_controlHandler === null) {
			if ($this->hasLocator() && $this->getLocator()->has($this->_controlHandlerServiceId)) {
				$this->_controlHandler = $this->getLocator()->get($this->_controlHandlerServiceId);
				
				if (! $this->_controlHandler instanceof ControlHandlerInterface) {
					throw new RuntimeException('Pagination control handler must implement "ControlHandlerInterface"');
				}
			} else {
				$this->_controlHandler = new Sliding();
			}
		}
		
		return $this->_controlHandler;
	}
188321
public long getPreviousSequenceId()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getPreviousSequenceId");
    long previousSequenceID=0;
    try
    {
      SIMPMessage msg = getSIMPMessage();
      if(msg!=null)
      {
        previousSequenceID = msg.getMessage().getGuaranteedValueStartTick()-1;
      }
    }
    catch (SIResourceException e)
    {
      // No FFDC code needed
      SibTr.exception(tc, e);
    } 
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getPreviousSequenceId", Long.valueOf(previousSequenceID));
    return previousSequenceID;
  }
336011
final public static function getBaseException(\Exception $exception)
    {
        while ($exception->getPrevious() !== null) {
            $exception = $exception->getPrevious();
        }

        return $exception;
    }
597993
public function inspect($variable = null, string $next = null)
    {
        //we are using tool in all cases
        $class = get_class($this);

        $inspector = $this->getInspectorHandler();

        //if variable is null
        if (is_null($variable)) {
            //output the class
            $inspector
                ->output(sprintf(InspectorHandler::INSPECT, $class))
                ->output($this);

            return $this;
        }

        //if variable is true
        if ($variable === true) {
            //return whatever the next response is
            //or return the next specified variable
            return $inspector->next($this, $next);
        }

        //if variable is not a string
        if (!is_string($variable)) {
            //output variable
            $inspector
                ->output(sprintf(InspectorHandler::INSPECT, 'Variable'))
                ->output($variable);

            return $this;
        }

        //if variable is set
        if (isset($this->$variable)) {
            //output it
            $inspector
                ->output(sprintf(InspectorHandler::INSPECT, $class.'->'.$variable))
                ->output($this->$variable);

            return $this;
        }

        //any other case output variable
        $inspector
            ->output(sprintf(InspectorHandler::INSPECT, 'Variable'))
            ->output($variable);

        return $this;
    }
199200
public function getRequestException()
    {
        if (!is_null($this->requestException)) {
            return $this->requestException;
        }

        $search = function (\Exception $exception = null) use (&$search) {
            $previous = $exception->getPrevious();

            if (is_null($previous)) {
                return null;
            }

            if ($previous instanceof RequestException) {
                return $this->requestException = $previous;
            }

            return $search($previous);
        };

        return $search($this);
    }
1180262
@Override
    public ExceptionHandler getExceptionHandler(Exception exception) {
        Class<? extends Exception> exceptionClass = exception.getClass();
        if (!exceptionHandlers.containsKey(exceptionClass)) {
            Class<?> superClass = exceptionClass.getSuperclass();
            while (superClass != null) {
                if (exceptionHandlers.containsKey(superClass)) {
                    ExceptionHandler exceptionHandler = exceptionHandlers.get(superClass);
                    exceptionHandlers.put(exceptionClass, exceptionHandler);

                    return exceptionHandler;
                }

                superClass = superClass.getSuperclass();
            }

            // avoid superclass traversal in the future if we didn't find a handler
            exceptionHandlers.put(exceptionClass, null);
        }

        return exceptionHandlers.get(exceptionClass);
    }
56205
public function getIndexConfigurator()
    {
        static $indexConfigurator;

        if (! $indexConfigurator) {
            if (! isset($this->indexConfigurator) || empty($this->indexConfigurator)) {
                throw new Exception(sprintf(
                    'An index configurator for the %s model is not specified.',
                    __CLASS__
                ));
            }

            $indexConfiguratorClass = $this->indexConfigurator;
            $indexConfigurator = new $indexConfiguratorClass;
        }

        return $indexConfigurator;
    }
80914
protected function getMessageForException($exception, $isPrevious = false)
    {
        $message = sprintf(
            '%s[%s] %s',
            $isPrevious ? "\nCaused by: " : '',
            get_class($exception),
            $exception->getMessage()
        );
        $debug = Configure::read('debug');

        if ($debug && $exception instanceof CakeException) {
            $attributes = $exception->getAttributes();
            if ($attributes) {
                $message .= "\nException Attributes: " . var_export($exception->getAttributes(), true);
            }
        }

        if ($this->getConfig('trace')) {
            $message .= "\n" . $exception->getTraceAsString();
        }

        $previous = $exception->getPrevious();
        if ($previous) {
            $message .= $this->getMessageForException($previous, true);
        }

        return $message;
    }
841603
private function getErrorHandler(Throwable $exception): ?ErrorHandlerInterface
    {
        $errorHandler = null;

        // search from the end of the array because we need to take the last added handler (LIFO style)
        foreach (array_reverse($this->handlers) as $exceptionType => $handler) {
            if (\is_a($exception, $exceptionType)) {
                $errorHandler = $handler;

                break;
            }
        }

        return $errorHandler;
    }
710979
public Entry getPrevious()
  {
    checkEntryParent();

    Entry entry = null;

    if(!isFirst())
    {
      entry = previous;
    }

    return entry;
  }
312699
public function getError()
    {
        if (!$this->isDone() || is_null($this->lastProtoResponse->getError())) {
            return null;
        }
        return $this->lastProtoResponse->getError();
    }
765926
protected function registerExceptionHandler()
    {
        $previousHandler = null;
        if ($this->app->bound(ExceptionHandlerInterface::class) === true) {
            $previousHandler = $this->app->make(ExceptionHandlerInterface::class);
        }

        $this->app->singleton(ExceptionHandlerInterface::class, function () use ($previousHandler) {
            return new JsonApiExceptionHandler($this->app, $previousHandler);
        });
    }