Reply to post: Delayed action alarm

DBA drifts into legend after inventive server convo leaves colleagues fearing for their lives

Nick Kew

Delayed action alarm

As a developer, I've been known to alarm people in the future with a log event.

Example: do_something() returns a status which could be OK, ERROR1, or ERROR2. So we handle errors with something like:

switch(rv = do_something()) {

case OK: // all's well

case ERROR1: // handle it

case ERROR2: // handle it

default:

log_error(rv, "Bug! This can't happen");

}

Sometime down the line, do_something() gets updated and returns ERROR3 for some new situation. Then comes the alarmed note in the bug report when someone excitable reads their log.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon