RE: [PHP-WIN] Better Error Trapping!
| From: | HKG) | Date: | Fri, 04 Apr 2003 08:28:12 +0000 |
| Subject: | RE: [PHP-WIN] Better Error Trapping! | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19288@lists.php.net to get a copy of this message | ||
> I'd love to hear other people's input on this and how they are attacking
> this problem!
Simply using defensive programming; e.g. never assume you get
the resources you ask for, but also assume input you get is
incorrect.
Abstract pseudo code:
TRY DO_EVENT
IF DO_EVENT_SUCCESS
CONTINUE_NORMAL_EXECUTION
ELSE_IF DO_EVENT_FAILS
FIND_OUT_REASON_OF_FAILURE
INVOKE_RECOVERY_MODULE
IF RECOVERY_MODULE_SUCCED
CONTINUE_NORMAL_EXECUTION
ELSE
MAKE_ERROR_REPORT_AND_FAIL
END_IF_INNER
END_IF_OUTTER