Hi,

i'm working with zend_pdf and when the document i'm trying to open isn't a
pdf document or it's password protected i receive an exception as expected.

But i seem unable to extract the specific error code.

My exception block look like this:

            }catch(Zend_Pdf_Exception $e ){
print_r($e);
                     echo "Caught exception: " . get_class($e) . "\n";
                    echo "code =: " . $e->getCode() . "\n";
            $form->addError($e->getMessage());
               $form->populate($formData);
               return;

            }

but all i'm able to see in code is 0.

my print_r of the eception loks like this (only relevant part):

Zend_Pdf_Exception Object ( [message:protected] => File is not a PDF.
[string:private] => [code:protected] => 0 [file:protected] =>
/usr/share/Zend/library/Zend/Pdf/Parser.php [line:protected] => 398
[trace:private] => Array ( [0] => Array ( [file] =>
/usr/share/Zend/library/Zend/Pdf.php [line] => 292 [function] => __construct
[class] => Z

i would have expected some of the codes described in the zend_pdf_exception
documentation.

Am i missing something here?

My zend version is 1.8.3 (maybe .4) 

Btw, is $form->addError working in this version of zend? i don't think i see
the error message i try to add in my exception block.

best regards

kim
-- 
View this message in context: 
http://old.nabble.com/Zend_pfp_exception-getcode-tp26317987p26317987.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to