[UPHPU] class breakage
Walt Haas
haas at xmission.com
Tue Oct 10 13:31:20 MDT 2006
Steve Dibb <steve at wonkabar.org> wrote:
> Some of the functions must work correctly with passed in parameters or I
> need to slap the developer on the hand. What's the best approach for
> this? I don't want to call 'die' specifically, but I do want to call
> trigger_error().
>
> The question is, which error should I use? E_USER_WARNING on a default
> install would let them keep going, though the rest of the functions they
> call on the class would die as well. E_USER_ERROR would throw a fatal
> error and stop them in their tracks.
>
> The class is just for displaying HTML forms, btw, so nothing too serious.
Well, it depends on the context in which you detect the error. During
unit testing with PHPUnit2, you indicate failure with a call to
PHPUnit2_Framework_Assert::fail("error message goes here").
If a bug gets into a production system, it's a lot harder because you
need to think of what's sensible and how much trouble you get into by
trying to continue after the bug.
-- Walt
-------
Walt Haas The Web Site Doctor - Cures Sick Web Sites
(801) 534-1262 http://thewebsitedoctor.net
More information about the UPHPU
mailing list