mlutfy / reporterror

Sends you a detailed email when a CiviCRM fatal error occurs.
https://lab.civicrm.org/extensions/reporterror
9 stars 7 forks source link

Report Error CiviCRM Extension

Sometimes CiviCRM can be real tough to debug. Especially when you are getting fatal errors, but only by some users, and you can't recreate the problems. This utility will send you a detailed email when a CiviCRM fatal error occurs.

The extension can also offer to try to resolve some common errors:

To get the latest version of this module:
https://lab.civicrm.org/extensions/reporterror

Distributed under the terms of the GNU Affero General public license (AGPL). See LICENSE.txt for details.

Installation

If you are installing from the git repository, you must run 'composer install'.

Otherwise, please use the packages from the official releases:
https://lab.civicrm.org/extensions/reporterror/-/releases

or from the releases listed on:
https://civicrm.org/extensions/civicrm-error-handler

Requirements

Contributors

Logging PEAR/DB errors

Some PEAR and database errors are handled by a separate handler of CiviCRM. For this extension to handle those errors, apply this patch:

diff --git a/sites/all/modules/civicrm/CRM/Core/Error.php b/sites/all/modules/civicrm/CRM/Core/Error.php
--- a/civicrm/CRM/Core/Error.php
+++ b/civicrm/CRM/Core/Error.php
@@ -221,6 +221,19 @@ class CRM_Core_Error extends PEAR_ErrorStack {
       }
     }

+    if ($config->fatalErrorHandler && function_exists($config->fatalErrorHandler)) {
+      $name = $config->fatalErrorHandler;
+      $vars = [
+        'pearError' => $pearError,
+      ];
+      $ret = $name($vars);
+      if ($ret) {
+        // the call has been successfully handled
+        // so we just exit
+        self::abend(CRM_Core_Error::FATAL_ERROR);
+      }
+    }
+

(this patches the handle($pearError) function)

Support

Please post bug reports in the issue tracker of this project on github:
https://lab.civicrm.org/extensions/reporterror/issues

This is a community contributed extension written thanks to the financial support of organisations using it, as well as the very helpful and collaborative CiviCRM community.

Please consider financially contributing to support and further develop this extension.

Commercial support is available through Coop SymbioTIC:
https://www.symbiotic.coop/en

Copyright

License: AGPL 3

Copyright (C) 2012-2018 CiviCRM LLC (info@civicrm.org)
https://civicrm.org

Copyright (C) 2012-2020 Mathieu Lutfy (mathieu@symbiotic.coop)
https://www.symbiotic.coop/en