v5:userguide:error_handling
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:userguide:error_handling [2016/01/13 02:31] – ↷ Links adapted because of a move operation mnewnham | v5:userguide:error_handling [2018/06/27 16:18] (current) – function names starting with lowercase (#430) dregad | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== PHP set_error_handler ===== | ===== PHP set_error_handler ===== | ||
| - | Once the PHP set_error_handler is used to override the default error handling, then the ' | + | Once the PHP set_error_handler is used to override the default error handling, then the ' |
| - | --------------------------------------- | + | |
| + | --------------------------------------------------- | ||
| <WRAP right box round> | <WRAP right box round> | ||
| == See Also == | == See Also == | ||
| - | [[v5: | + | [[v5: |
| </ | </ | ||
| ===== adodb-errorhandler.inc.php ===== | ===== adodb-errorhandler.inc.php ===== | ||
| Line 41: | Line 43: | ||
| </ | </ | ||
| - | + | ||
| ===== Override Error Trap/Resume ===== | ===== Override Error Trap/Resume ===== | ||
| Line 65: | Line 67: | ||
| set_error_handler(' | set_error_handler(' | ||
| - | $db->Execute('DROP INDEX index_that_might_not_exist' | + | $db->execute('DROP INDEX index_that_might_not_exist' |
| /* | /* | ||
| Line 73: | Line 75: | ||
| $db-> | $db-> | ||
| + | </ | ||
| + | |||
| + | ===== Using A Class Method ===== | ||
| + | <code php> | ||
| + | class c | ||
| + | { | ||
| + | function e() | ||
| + | { | ||
| + | print "ERROR TRAP"; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | $c = new c; | ||
| + | |||
| + | $db-> | ||
| </ | </ | ||
| Line 107: | Line 124: | ||
| try | try | ||
| { | { | ||
| - | $db = NewADOConnection(" | + | $db = newADOConnection(" |
| } | } | ||
| Line 138: | Line 155: | ||
| - | $c = NewADOConnection(' | + | $c = newADOConnection(' |
| - | $c->PConnect(' | + | $c->pConnect(' |
| - | $rs=$c->Execute(' | + | $rs=$c->execute(' |
| if ($rs) | if ($rs) | ||
| Line 163: | Line 180: | ||
| include(' | include(' | ||
| - | $c = NewADOConnection(' | + | $c = newADOConnection(' |
| - | $c->PConnect(' | + | $c->pConnect(' |
| - | $rs=$c->Execute(' | + | $rs=$c->execute(' |
| if ($rs) | if ($rs) | ||
| Line 191: | Line 208: | ||
| ===== MetaError and MetaErrMsg ===== | ===== MetaError and MetaErrMsg ===== | ||
| - | If you need error messages that work across multiple databases, then use [[v5: | + | If you need error messages that work across multiple databases, then use [[v5: |
| ===== Error Messages ===== | ===== Error Messages ===== | ||
| - | Error messages are outputted using the static method ADOConnnection:: | + | Error messages are outputted using the static method |
| + | |||
| + | | ||
| + | |||
| + | By default, it sends the messages to the standard output. You can override this to perform error logging. | ||
v5/userguide/error_handling.1452648713.txt.gz · Last modified: (external edit)
