<commit_before><sect1 id="zend.exception.using">

    <title>Using Exceptions</title>

    <para>
        All exceptions thrown by Zend Framework classes should throw
        an exception that derives from the base class Zend_Exception.
    </para>

    <example id="zend.exception.using.example">
        <title>Example of catching an exception</title>
        <programlisting role="php"><![CDATA[
try {
    Zend_Loader::loadClass('nonexistantclass');
} catch (Zend_Exception $e) {
    echo "Caught exception: " . get_class($e) . "\n";
    echo "Message: " . $e->getMessage() . "\n";
    // other code to recover from the failure.
}
]]>
        </programlisting>
    </example>

    <para>
        See the documentation for each respective Zend Framework
        component for more specific information on which methods
        throw exceptions, the circumstances for the exceptions,
        and which exception classes derive from Zend_Exception.
    </para>

</sect1>
<!--
vim:se ts=4 sw=4 et:
--><commit_msg>Significant content update. Translation required.<commit_after><sect1 id="zend.exception.using">

    <title>Using Exceptions</title>

    <para>
        All exceptions thrown by classes in Zend Framework should extend the base class Zend_Exception.
    </para>

    <example id="zend.exception.using.example">
        <title>Catching an Exception</title>
        <para>
            The following code listing demonstrates how to catch an exception thrown within a Zend Framework class:
        </para>
        <programlisting role="php"><![CDATA[
try {
    // Calling Zend_Loader::loadClass() with a non-existant class will cause
    // an exception to be thrown in Zend_Loader
    Zend_Loader::loadClass('nonexistantclass');
} catch (Zend_Exception $e) {
    echo "Caught exception: " . get_class($e) . "\n";
    echo "Message: " . $e->getMessage() . "\n";
    // Other code to recover from the error
}
]]>
        </programlisting>
    </example>

    <para>
        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.
    </para>

</sect1>
<!--
vim:se ts=4 sw=4 et:
-->
{'fraction_non_alphanumeric': 0.10888501742160278, 'fraction_numerical': 0.003484320557491289, 'mean_word_length': 2.919795221843003, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2365170', 'n_tokens_mistral': 650, 'n_tokens_neox': 613, 'n_words': 224}