Yaf_Application::getLastErrorMsg

(Yaf >=2.1.2)

Yaf_Application::getLastErrorMsgRécupère le message de la dernière erreur survenue

Description

public Yaf_Application::getLastErrorMsg ( void ) : string

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Exemples

Exemple #1 Exemple avec Yaf_Application::getLastErrorMsg()

<?php
function error_handler($errno$errstr$errfile$errline) {
   
var_dump(Yaf_Application::app()->getLastErrorMsg());
}

$config = array(                   
 
"application" => array(
   
"directory" => "/tmp/notexists",
     
"dispatcher" => array(
       
"throwException" => 0//lance une erreur au lieu de lancer une exception lorsqu'une erreur survient
      
),
  ),
);

$app = new Yaf_Application($config);
$app->getDispatcher()->setErrorHandler("error_handler"E_RECOVERABLE_ERROR);
$app->run();
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

string(69) "Could not find controller script /tmp/notexists/controllers/Index.php"