From: highfalutin Date: Wed, 14 Apr 2021 05:59:41 +0000 (-0700) Subject: Make error text more helpful and spelt correckly X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a23ae00818b86dea6a5206dfa432e4e35ff6ade1;p=civicrm-core.git Make error text more helpful and spelt correckly Provide a bit more context when possible. --- diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index 0cf1843286..e8e7160cab 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -532,7 +532,7 @@ class CRM_Core_CodeGen_Specification { // all fieldnames have to be defined and should exist in schema. foreach ($primaryKey['field'] as $fieldName) { if (!$fieldName) { - echo "Invalid field defination for index $name\n"; + echo "Invalid field definition for index '$name' in table ${table['name']}\n"; return; } $parenOffset = strpos($fieldName, '('); @@ -540,7 +540,7 @@ class CRM_Core_CodeGen_Specification { $fieldName = substr($fieldName, 0, $parenOffset); } if (!array_key_exists($fieldName, $fields)) { - echo "Table does not contain $fieldName\n"; + echo "Missing definition of field '$fieldName' for index '$name' in table ${table['name']}\n"; print_r($fields); exit(); } @@ -596,7 +596,7 @@ class CRM_Core_CodeGen_Specification { // all fieldnames have to be defined and should exist in schema. foreach ($index['field'] as $fieldName) { if (!$fieldName) { - echo "Invalid field defination for index $indexName\n"; + echo "Invalid field definition for index '$indexName'\n"; return; } $parenOffset = strpos($fieldName, '('); @@ -604,7 +604,7 @@ class CRM_Core_CodeGen_Specification { $fieldName = substr($fieldName, 0, $parenOffset); } if (!array_key_exists($fieldName, $fields)) { - echo "Table does not contain $fieldName\n"; + echo "Missing definition of field '$fieldName' for index '$indexName'. Fields defined:\n"; print_r($fields); exit(); } @@ -623,7 +623,7 @@ class CRM_Core_CodeGen_Specification { /** need to make sure there is a field of type name */ if (!array_key_exists($name, $fields)) { - echo "foreign $name in $currentTableName does not have a field definition, ignoring\n"; + echo "Foreign key '$name' in $currentTableName does not have a field definition, ignoring\n"; return; }