Database Failure - custom message

Is there a way to change the message for users? When the DB fails - I’d rather tell them to contact their system admin and then return them to the screen they were just on. I have put a hard stop on specific information on DB-side instead of coding it into SuiteCRM.

I’ve checked the files they reference

CRM/include/MVC/Controller/SugarController.php:400
CRM/include/database/DBManager.php(353)
CRM/include/database/DBManager.php(328)
CRM/include/database/MysqliManager.php(179)
CRM/include/database/DBManager.php(519)

etc but none of them have that message. DBManager.php is the one I think is where it comes from but it refers to

if ($dieOnError || $this->dieOnError) {
if (isset($GLOBALS[‘app_strings’][‘ERR_DB_FAIL’])) {
sugar_die($GLOBALS[‘app_strings’][‘ERR_DB_FAIL’]);

Hey,

It looks like the “ERR_DB_FAIL” label can be found in:
/include/language/en_us.lang.php
Along with 2 other “ERR_DB_xxxx” labels, roughly around line ~1431


You can safely customize these strings in the Custom Language file, found at:
/custom/include/language/en_us.lang.php
(If this file does not exist, feel free to create it)

Ensure the file contains the following lines:

<?php

$app_strings['ERR_NO_DB'] = "Custom Message";
$app_strings['ERR_DB_FAIL'] = "Custom Message";
$app_strings['ERR_DB_VERSION'] = "Custom Message";

(Feel free to change the “Custom Message” content)


Then, the users should see your new custom messages when a DB error appears.

However, if you still don’t see it, let us know!

1 Like

Thank you! This is exactly what i was looking for

1 Like

Great,

Glad to hear!