Details
-
Type: Bug
-
Status: Won't Do
-
Priority: Minor
-
Resolution: Won't Do
-
Affects Version/s: 4.2.6
-
Fix Version/s: Unscheduled
-
Component/s: Core CiviCRM
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
Description
If the database error is not understood by PEAR, it will be displayed as empty, with no code or other debug information. A quick fix for debugging is to change packages/DB.php, line 971 to:
$this->PEAR_Error("DB Error: $code $debuginfo", DB_ERROR,
The only example I can give at the moment is a foreign key error caused by browsing to "civicrm/event/view_cart". The fatal error screen only shows: "DB Error: ", but the full error is displayed in $debuginfo: " 1452 ** Cannot add or update a child row: a foreign key constraint fails (`civi_trunk`.`civicrm_event_carts`, CONSTRAINT `FK_civicrm_event_carts_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL) [DB Error: unknown error]"
The correct fix is not to improve support for specific errors, but to provide a catch-all for unknown errors.