[OWASP_PHPSEC] Exceptions

Abbas Naderi abiusx at owasp.org
Fri May 31 07:08:25 UTC 2013


Hi,
The exception handling class is not in charge of defining exceptions, its in charge of handling them..
Your libraries should include their defined exceptions inside them, and should not try to catch them (unless necessary in some functionality). The developers using that library are in charge of handling those exceptions, either via our exception handling system, or by their own custom means.

Libraries should be as decoupled (least dependant) as possible.

The main role of exception handling class, is to convert PHP errors to effective PHP exceptions, and to show nicely human readable stack traces, and to log these errors if necessary.

Thanks
-Abbas
On ۱۰ خرداد ۱۳۹۲, at ۹:۰۵, rahul chaudhary <rahul300chaudhary400 at gmail.com> wrote:

> For handling exceptions, I made an exception class under "core" folder that handles exceptions for all libraries.
> 
> But Abhishek defined all the exceptions inside the correponding library itself.
> 
> Now I like his idea also. Given that its a stand-alone library, does it makes sense to move all exceptions in their corresponding libraries itself and get rid of the exception class overall ?
> 
> If yes, then I need to move some code.
> If no, then Abhishek needs to move his exception codes to the Exceptions class.
> 
> -- 
> Regards,
> Rahul Chaudhary
> Ph - 412-519-9634
> _______________________________________________
> OWASP_PHP_Security_Project mailing list
> OWASP_PHP_Security_Project at lists.owasp.org
> https://lists.owasp.org/mailman/listinfo/owasp_php_security_project



More information about the OWASP_PHP_Security_Project mailing list