Utilizzo delle eccezioni
Tutte le eccezioni lanciate dalle classi del Framework Zend dovrebbero estendere la classe base Zend_Exception.
Gestione di un'eccezione
Il codice seguente dimostra come gestire un'eccezione lanciata all'interno di una classe del Framework Zend:
getMessage() . "\n";
// Altro codice necessario per gestire l'errore
}
]]>
The documentation for each Zend Framework
component and class will contain specific information on which methods
throw exceptions, the circumstances that cause an exception to be thrown,
and the class of all exceptions that may be thrown.
La documentazione di ogni componente e classe del Framework Zend
contiene informazioni specifiche su quali metodi lanciano un'eccezione,
le circostanze che possono causare l'errore e le classi per tutte
le eccezioni che possono essere lanciate.