Neos\Fusion\TypoScriptObjects\Helpers\FusionPathProxy::__toString PHP Method

__toString() public method

As PHP does not like throwing an exception here, we render any exception using the configured TypoScript exception handler and will also catch and log any exceptions resulting from that as a last resort.
public __toString ( ) : string
return string
    public function __toString()
    {
        try {
            return (string) $this->objectAccess();
        } catch (\Exception $exceptionHandlerException) {
            try {
                // Throwing an exception in __toString causes a fatal error, so if that happens we catch them and use the context dependent exception handler instead.
                $contextDependentExceptionHandler = new ContextDependentHandler();
                $contextDependentExceptionHandler->setRuntime($this->fusionRuntime);
                return $contextDependentExceptionHandler->handleRenderingException($this->path, $exception);
            } catch (\Exception $contextDepndentExceptionHandlerException) {
                $this->systemLogger->logException($contextDepndentExceptionHandlerException, array('path' => $this->path));
                return sprintf('<!-- Exception while rendering exception in %s: %s (%s) -->', $this->path, $contextDepndentExceptionHandlerException->getMessage(), $contextDepndentExceptionHandlerException instanceof Exception ? 'see reference code ' . $contextDepndentExceptionHandlerException->getReferenceCode() . ' in log' : $contextDepndentExceptionHandlerException->getCode());
            }
        }
    }