[wp-hackers] Error Handling [was: Cron Improvements and Error Logging]

Robert Deaton false.hopes at gmail.com
Thu Mar 9 08:01:47 GMT 2006


On 3/9/06, Sam Angove <sam at rephrase.net> wrote:
> * If it's all "API'd out", Isn't it the error *handler* part that's
> needed in the core, then, rather than the logger? Logging can be just
> one of multiple possible actions when an error occurs, along with
> emailing/paging the admin, displaying a message, redirecting to
> another page...

And thus the API'd out, if you want to send e-mails, an early loaded
plugin could do so for most userspace events. A hook inside the error
handler could allow custom code to be run. However, logging is the
reason for having an error handler, and a generic logger has, imho,
been something we've needed for plugin developers for a while.

> * What about a pluggable error handler loaded like the object cache?

More editing files, pain in the butt, a user shouldn't have to go
through the hassle.

> * I'm concerned about reliance on a DB table because one of the errors
> I'm most interested in acting on is a failure to connect to the
> database.

If you can't connect to your database, you have bigger problems.
Besides, how would WP know your e-mail address on how to contact you
and all if you can't connect to the database to begin with?

> * It's hard to take action on specific errors unless there's some kind
> of error code system, and error codes are a pain to remember. Is it
> better to have a code for every different message -- in which case
> there'll be a *lot* -- or just a few, like a general
> "NOT_GOOD_ENOUGH_HA_HA" kind of thing sent with all of the permission
> denied messages, "CANT_READ_COMMENT_INSTRUCTIONS" for the comment
> posting errors, etc.?

Now you're assuming everything is going to trigger an error, and that
all things will have error codes. The database schema allows for you
to not ever really have to remember some set of error codes, you just
write in the error with the message you want to display and that's
that.

And did you really have to split this off into a seperate thread? The
whole point of the original was to get feedback on this.

--
--Robert Deaton
http://somethingunpredictable.com


More information about the wp-hackers mailing list