views:

25

answers:

1

i am using Zend Framework Zend_Acl i am wanting to throw an exception when the user is denied access to a resource. which exception class do i use?

A: 

AFAIK you don't have a specific exception for that, if that's what you're asking. Create your own exception class which extends from Zend_Exception and throw that.

robertbasic
can i say that such exception classes are just for the purposes for readability in code, and does nothing too different from 1 another?
jiewmeng
readability, plus based on the type of the exception or the exception code, you can do different things in the error controller (access denied, page not found, application error, etc...).
robertbasic
with `Zend_Exception`, i can also set the code right? `void __construct ([string $msg = ''], [int $code = 0], [ $previous = null]) `. the 2nd param?
jiewmeng