Matthew Peters wrote:
> What do other people think?
Matthew, the way I handled this in SDO was to introduce a
"cause"
property, with a getCause() public accessor, plus an
additional
optional parameter on the constructor for setting it. You
can assign
any object into the cause, though normally it would be the
originating
exception.
Keeping this data separate from the other properties of the
exception
gives you a choice over when it is output. In particular,
there's no
reason for the getMessage() output to be the same as the
__toString()
output. Whereas if you have logging turned on, I'd expect
all available
data, including the cause, to be written to the log.
Using these two techniques may give you enough control to
preserve the
information for when it's needed without displaying it when
it's
inappropriate.
(BTW, I didn't myself make up this pattern, I just copied it
from
Another Language Beginning with J.)
--
Caroline
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "phpsoa" group.
To post to this group, send email to phpsoa googlegroups.com
To unsubscribe from this group, send email to
phpsoa-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---
|