source/Core/UtilsView.php
public function addErrorToDisplay($oEr, $blFull = false, $useCustomDestination = false, $customDestination = "", $activeController = "")
    {
        //default
        $destination = 'default';
        $customDestination = $customDestination ? $customDestination : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('CustomError');
        if ($useCustomDestination && $customDestination) {
            $destination = $customDestination;
        }

        //starting session if not yet started as all exception
        //messages are stored in session
        $session = $this->getSession();
        if (!$session->getId() && !$session->isHeaderSent()) {
            $session->setForceNewSession();
            $session->start();
        }

        $aEx = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('Errors');
        if ($oEr instanceof \OxidEsales\Eshop\Core\Exception\StandardException) {
            $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class);
            $oEx->setMessage($oEr->getMessage());
            $oEx->setExceptionType($oEr->getType());

            if ($oEr instanceof \OxidEsales\Eshop\Core\Exception\SystemComponentException) {
                $oEx->setMessageArgs($oEr->getComponent());
            }

            $oEx->setValues($oEr->getValues());
            $oEx->setStackTrace($oEr->getTraceAsString());
            $oEx->setDebug($blFull);
            $oEr = $oEx;
        } elseif ($oEr && !($oEr instanceof \OxidEsales\Eshop\Core\Contract\IDisplayError)) {
            // assuming that a string was given
            $sTmp = $oEr;
            $oEr = oxNew(\OxidEsales\Eshop\Core\DisplayError::class);
            $oEr->setMessage($sTmp);
        } elseif ($oEr instanceof \OxidEsales\Eshop\Core\Contract\IDisplayError) {
            // take the object
        } else {
            $oEr = null;
        }

        if ($oEr) {
            $aEx[$destination][] = serialize($oEr);
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('Errors', $aEx);

            if ($activeController == '') {
                $activeController = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('actcontrol');
            }
            if ($activeController) {
                $aControllerErrors[$destination] = $activeController;
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('ErrorController', $aControllerErrors);
            }
        }
    }
public function addErrorToDisplay($oEr, $blFull = false, $useCustomDestination = false, $customDestination = "", $activeController = "")
    {
        //default
        $destination = 'default';
        $customDestination = $customDestination ? $customDestination : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('CustomError');
        if ($useCustomDestination && $customDestination) {
            $destination = $customDestination;
        }

        //starting session if not yet started as all exception
        //messages are stored in session
        $session = $this->getSession();
        if (!$session->getId() && !$session->isHeaderSent()) {
            $session->setForceNewSession();
            $session->start();
        }

        $aEx = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('Errors');
        if ($oEr instanceof \OxidEsales\Eshop\Core\Exception\StandardException) {
            $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class);
            $oEx->setMessage($oEr->getMessage());
            $oEx->setExceptionType($oEr->getType());

            if ($oEr instanceof \OxidEsales\Eshop\Core\Exception\SystemComponentException) {
                $oEx->setMessageArgs($oEr->getComponent());
            }

            $oEx->setValues($oEr->getValues());
            $oEx->setStackTrace($oEr->getTraceAsString());
            $oEx->setDebug($blFull);
            $oEr = $oEx;
        } elseif ($oEr && !($oEr instanceof \OxidEsales\Eshop\Core\Contract\IDisplayError)) {
            // assuming that a string was given
            $sTmp = $oEr;
            $oEr = oxNew(\OxidEsales\Eshop\Core\DisplayError::class);
            $oEr->setMessage($sTmp);
        } elseif ($oEr instanceof \OxidEsales\Eshop\Core\Contract\IDisplayError) {
            // take the object
        } else {
            $oEr = null;
        }

        if ($oEr) {
            $aEx[$destination][] = serialize($oEr);
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('Errors', $aEx);

            if ($activeController == '') {
                $activeController = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('actcontrol');
            }
            if ($activeController) {
                $aControllerErrors[$destination] = $activeController;
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('ErrorController', $aControllerErrors);
            }
        }
    }
public function addErrorToDisplay ( $ oEr , $ blFull = false , $ useCustomDestination = false , $ customDestination = "" , $ activeController = "" ) { //default $ destination = 'default' ; $ customDestination = $ customDestination ? $ customDestination : \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'CustomError' ) ; if ( $ useCustomDestination && $ customDestination ) { $ destination = $ customDestination ; } //starting session if not yet started as all exception //messages are stored in session $ session = $ this -> getSession ( ) ; if ( ! $ session -> getId ( ) && ! $ session -> isHeaderSent ( ) ) { $ session -> setForceNewSession ( ) ; $ session -> start ( ) ; } $ aEx = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( 'Errors' ) ; if ( $ oEr instanceof \ OxidEsales \ Eshop \ Core \ Exception \ StandardException ) { $ oEx = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ ExceptionToDisplay :: class ) ; $ oEx -> setMessage ( $ oEr -> getMessage ( ) ) ; $ oEx -> setExceptionType ( $ oEr -> getType ( ) ) ; if ( $ oEr instanceof \ OxidEsales \ Eshop \ Core \ Exception \ SystemComponentException ) { $ oEx -> setMessageArgs ( $ oEr -> getComponent ( ) ) ; } $ oEx -> setValues ( $ oEr -> getValues ( ) ) ; $ oEx -> setStackTrace ( $ oEr -> getTraceAsString ( ) ) ; $ oEx -> setDebug ( $ blFull ) ; $ oEr = $ oEx ; } elseif ( $ oEr && ! ( $ oEr instanceof \ OxidEsales \ Eshop \ Core \ Contract \ IDisplayError ) ) { // assuming that a string was given $ sTmp = $ oEr ; $ oEr = oxNew ( \ OxidEsales \ Eshop \ Core \ DisplayError :: class ) ; $ oEr -> setMessage ( $ sTmp ) ; } elseif ( $ oEr instanceof \ OxidEsales \ Eshop \ Core \ Contract \ IDisplayError ) { // take the object } else { $ oEr = null ; } if ( $ oEr ) { $ aEx [ $ destination ] [ ] = serialize ( $ oEr ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'Errors' , $ aEx ) ; if ( $ activeController == '' ) { $ activeController = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'actcontrol' ) ; } if ( $ activeController ) { $ aControllerErrors [ $ destination ] = $ activeController ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'ErrorController' , $ aControllerErrors ) ; } } }
Adds an exception to the array of displayed exceptions for the view
by default is displayed in the inc_header, but with the custom destination set to true
the exception won't be displayed by default but can be displayed where ever wanted in the tpl

@param StandardException|IDisplayError|string $oEr                  an exception object or just a language local (string),
which will be converted into a oxExceptionToDisplay object
@param bool                                   $blFull               if true the whole object is add to display (default false)
@param bool                                   $useCustomDestination true if the exception shouldn't be displayed
at the default position (default false)
@param string                                 $customDestination    defines a name of the view variable containing
the messages, overrides Parameter 'CustomError' ("default")
@param string                                 $activeController     defines a name of the controller, which should
handle the error.
Adds an exception to the array of displayed exceptions for the view by default is displayed in the inc_header but with the custom destination set to true the exception won t be displayed by default but can be displayed where ever wanted in the tpl