Dutch PHP Conference 2027

Yaf_Request_Abstract::getException

(Yaf >=1.0.0)

Yaf_Request_Abstract::getExceptionRetrieve the exception

Açıklama

public function Yaf_Request_Abstract::getException(): ?Exception

Retrieve the exception caught during dispatching.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

The Exception caught during dispatching, or null if none.

Örnekler

Örnek 1 Yaf_Request_Abstract::getException() example

<?php
// In the bootstrap, enable exception catching so that any exception
// thrown during dispatching is forwarded to the error action
Yaf_Dispatcher::getInstance()->catchException(true);

class ErrorController extends Yaf_Controller_Abstract
{
    public function errorAction($exception)
    {
        var_dump($this->getRequest()->getException() === $exception);
    }
}
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

bool(true)

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top