Re: Which Exception to use ....
| From: | Jochem Maas | Date: | Fri, 22 Aug 2008 16:35:31 +0000 |
| Subject: | Re: Which Exception to use .... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278534@lists.php.net to get a copy of this message | ||
Pavel schreef:
//sorry for my english Firstly, this list of exception show only registered in system exceptions,yes I know, I wrote exactly that in the first line of my post.
which (excluding one-two) are exceptions of some php mobules:mysqli,sqllite and so on...it's 5 actually, I mentioned that also.
I use only Exception class and my extends on it (so and exceptions from your list are extends...).yes, I know. they have to, it's an engine requirement, if you STW you can even find a class heirarchy diagram that documents them. the point is I'm writing a small site/app and I can't be arsed to write a stack of custom Exceptions and an autoloader etc because it's too much hassle for the simplistic nature of what I'm putting together ... so I figured I'd use built-in exceptions where I can because being able to differentiate certain 'types' of exception is quite handy, making everything a plain Exception is rather blunt (rather like doing surgery with a spoon). ... which is where my original question(s) come in. personally I find the built-ins rather useless unless you fancy being super pendantic with your exceptions (UnderflowException anyone?!?), seems the built-in exceptions don't really cover (m)any general situations. maybe a missing config file should be a RunTimeException ... still leaves the questions as to what a DomainException and a ErrorException is meant to model.