| 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 |
|
* |