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 revisionBoth sides next revision
v5:userguide:error_handling [2016/02/01 23:32] – [Error Messages] mnewnhamv5:userguide:error_handling [2016/02/01 23:56] mnewnham
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 '@' PHP value ceases to be honored, and any SQL statement execution that fails will then produce a fatal error in the statement. We must then implement an error handling layer to trap the error and process it as the required. The first way to do that is by the use of the ''adodb-errorhandler.inc'' file.  +Once the PHP set_error_handler is used to override the default error handling, then the '@' PHP value ceases to be honored, and any SQL statement execution that fails will then produce a fatal error in the statement. We must then implement an error handling layer to trap the error and process it as the required. The first way to do that is by the use of the ''adodb-errorhandler.inc'' file. 
----------------------------------------+ 
 +--------------------------------------------------- 
 <WRAP right box round> <WRAP right box round>
 == See Also == == See Also ==
Line 41: Line 43:
    
 </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.
v5/userguide/error_handling.txt · Last modified: 2018/06/27 16:18 by dregad