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?
views:
25answers:
1
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
2010-08-03 06:30:41
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
2010-08-03 08:37:08
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
2010-08-03 08:59:15
with `Zend_Exception`, i can also set the code right? `void __construct ([string $msg = ''], [int $code = 0], [ $previous = null]) `. the 2nd param?
jiewmeng
2010-08-04 10:43:57