ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:error_handling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
v5:userguide:error_handling [2016/02/01 23:56] mnewnhamv5:userguide:error_handling [2016/02/02 03:30] mnewnham
Line 44: Line 44:
 </code> </code>
  
--------------------------------------------------- +
-<WRAP right box info 300px> +
-Currently, the raiseErrorFn must be a function, not a class method. +
-</WRAP>+
 ===== Override Error Trap/Resume ===== ===== Override Error Trap/Resume =====
 In certain circumstances, it may be necessary to trap errors differently or override the normal error handling. The current error handler, which is stored in the class variable  ''raiseErrorFn'', can be temporarily replaced. In this example, we use that functionality to ignore a database error. In certain circumstances, it may be necessary to trap errors differently or override the normal error handling. The current error handler, which is stored in the class variable  ''raiseErrorFn'', can be temporarily replaced. In this example, we use that functionality to ignore a database error.
Line 78: Line 75:
 $db->raiseErrorFn = $saveErrorFn; $db->raiseErrorFn = $saveErrorFn;
  
 +</code>
 +
 +===== Using A Class Method =====
 +<code php>
 +class c
 +{
 + function e()
 + {
 + print "ERROR TRAP";
 + }
 +}
 +
 +$c = new c;
 +
 +$db->raiseErrorFn = array($c,'e');
 </code> </code>
  
v5/userguide/error_handling.txt · Last modified: 2018/06/27 16:18 by dregad