/[drupal]/contributions/modules/civicrm_error/report_on_all_errors.diff
ViewVC logotype

Diff of /contributions/modules/civicrm_error/report_on_all_errors.diff

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Mon Jul 23 22:03:20 2007 UTC revision 1.1.2.1, Mon Jul 23 22:03:20 2007 UTC
# Line 0  Line 1 
1    Index: CRM/Core/Error.php
2    ===================================================================
3    --- CRM/Core/Error.php  (revision 8298)
4    +++ CRM/Core/Error.php  (revision 8365)
5    @@ -171,6 +171,8 @@
6                 mysql_query( 'select 1' );
7             }
8    
9    +        send_to_custom_handler($error);
10    +
11             $template->assign_by_ref('error', $error);
12    
13             if ( $config->initialized ) {
14    @@ -221,16 +223,7 @@
15    
16             $config =& CRM_Core_Config::singleton( );
17    
18    -        if ( $config->fatalErrorHandler &&
19    -             function_exists( $config->fatalErrorHandler ) ) {
20    -            $name = $config->fatalErrorHandler;
21    -            $ret = $name( $vars );
22    -            if ( $ret ) {
23    -                // the call has been successfully handled
24    -                // so we just exit
25    -                exit( CRM_CORE_ERROR_FATAL_ERROR );
26    -            }
27    -        }
28    +        $this->send_to_custom_handler( $vars, true );
29    
30             if ( $config->backtrace ) {
31                 CRM_Core_Error::backtrace( );
32    @@ -243,7 +236,34 @@
33             exit( CRM_CORE_ERROR_FATAL_ERROR );
34         }
35    
36    +
37         /**
38    +     * if there is a custom error handling funciton, call it
39    +     *
40    +     * @param string error    an array of error details
41    +     * @param bool fatal      if fatal is true we will exit()
42    +     *
43    +     * @return void
44    +     * @static
45    +     * @acess public
46    +     */
47    +    function send_to_custom_handler($error = null, $fatal = false) {
48    +
49    +        $config =& CRM_Core_Config::singleton( );
50    +
51    +        if ( $config->fatalErrorHandler &&
52    +             function_exists( $config->fatalErrorHandler ) ) {
53    +            $name = $config->fatalErrorHandler;
54    +            $ret = $name( $error );
55    +            if ( $ret && $fatal) {
56    +                // the call has been successfully handled
57    +                // so we just exit
58    +                exit( CRM_CORE_ERROR_FATAL_ERROR );
59    +            }
60    +        }
61    +    }
62    +
63    +    /**
64          * outputs pre-formatted debug information. Flushes the buffers
65          * so we can interrupt a potential POST/redirect
66          *

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2