rfc:enhanced_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
rfc:enhanced_error_handling [2010/01/10 16:13] kampfcasparrfc:enhanced_error_handling [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Request for Comments: Enhanced Error Handling ====== ====== Request for Comments: Enhanced Error Handling ======
-  * Version: 0.4 +  * Version: 0.5 
-  * Date:    2010-01-07+  * Date:    2010-01-10
   * Author:  Hans-Peter Oeri <hp@oeri.ch>   * Author:  Hans-Peter Oeri <hp@oeri.ch>
-  * Status:  Drafting+  * Status:  Draft (Inactive)
   * First Published at: http://wiki.php.net/rfc/enhanced_error_handling   * First Published at: http://wiki.php.net/rfc/enhanced_error_handling
  
 ===== Introduction ===== ===== Introduction =====
  
-php_error(), zend_throw_extension(), the @-operator... PHP and/or the Zend Engine respectively offer a variety of error issuance and handling mechanisms. There is, however, no encompassing concepts: Core functions only issue php_errors (suppressable), intl 1.0.3 by default suppresses all errors but can activate php_errors, pdo however has a flag to define error behaviour that allows exceptions - but limits php_error to E_WARNING. Furthermore, each extension has a different way of changing its error behaviour etc. etc.+php_error(), zend_throw_exception(), the @-operator... PHP and/or the Zend Engine respectively offer a variety of error issuance and handling mechanisms. There is, however, no encompassing concepts: Core functions only issue php_errors (suppressable), intl 1.0.3 by default suppresses all errors but can activate php_errors, pdo however has a flag to define error behaviour that allows exceptions - but limits php_error to E_WARNING. Furthermore, each extension has a different way of changing its error behaviour etc. etc.
  
 I think that error behaviour has to be in the hands of the user (php coder). Different users have different preferences - and prefer different behaviour in different situations. I think that error behaviour has to be in the hands of the user (php coder). Different users have different preferences - and prefer different behaviour in different situations.
Line 33: Line 33:
 The goal would be to create a framework in which The goal would be to create a framework in which
   * the //PHP user// decides, what kind of error reaction he wishes; that includes   * the //PHP user// decides, what kind of error reaction he wishes; that includes
-  * having an "error callthat abstracts away from zend_errors/exceptions and +  * having a single //error call// that abstracts away from zend_errors/exceptions and 
-  * a minimal inheritance of error behaviours, such that different extensions and/or resource objects might be configured to react differently. +  * a minimal //inheritance of error behaviours//, such that different extensions and/or resource objects might be configured to react differently. 
-  * offers a C-level API for compiled extensions as well as a PHP-level API for frameworks in that language. +  * offers a //C-level API// for compiled extensions as well as a //PHP-level API// for frameworks in that language. 
-  * can be used in OOP as well as non-OOP situations.+  * can be used in //OOP// as well as //non-OOP// situations.
  
-Such goals can only be achieved under the side condition of complete backwards compatibility. Default behaviour of+ 
 +Such goals can only be achieved under the side condition of //complete backwards compatibility//. Default behaviour of
 existing php and extensions must not be changed - all existing error behaviour must be mappable. existing php and extensions must not be changed - all existing error behaviour must be mappable.
  
Line 60: Line 61:
 Existing extensions use their error mechanisms not only to issue grave errors, but also to Existing extensions use their error mechanisms not only to issue grave errors, but also to
 transport mere "warnings" to the user - much like a message transport. As this is pre-existing, transport mere "warnings" to the user - much like a message transport. As this is pre-existing,
-both an //error and a //warning call should be supplied. The latter - ignoring all configuration -+both an //error// and a //warning// call should be supplied. The latter - ignoring all configuration -
 choosing Suppress or Monitor as appropraiate action. choosing Suppress or Monitor as appropraiate action.
  
Line 92: Line 93:
 A lower hierarchy level could enforce the use of a specific exception class, e.g. PersonalIntlExceptionClass() for all of intl.so. While forcing such a common class does ease catching, some information a more specific class could provide is lost. A lower hierarchy level could enforce the use of a specific exception class, e.g. PersonalIntlExceptionClass() for all of intl.so. While forcing such a common class does ease catching, some information a more specific class could provide is lost.
  
-As of PHP 5.3, the concept of exception chaining has been introduced, whereas a "previous" extension can be attached. In order to keep the previously lost information, the concrete exception class given upon issuing an error should be chained to the enforced class.+As of PHP 5.3, the concept of exception chaining has been introduced, whereas a "previous" exception can be attached. In order to keep the previously lost information, the concrete exception class given upon issuing an error should be chained to the enforced class.
  
 ==== Notices ==== ==== Notices ====
rfc/enhanced_error_handling.1263140005.txt.gz · Last modified: 2017/09/22 13:28 (external edit)