Problem/Motivation

Whenever I got database exception when trying to add new field to a content type, the exception is shrinked only to SQL error number without full SQL query text. The exception is not written to any log or watchdog.
So there is no way to debug SQL problems got when creating new content types and fields.

Steps:
1) Make it impossible to create new tables in your SQL database.
2) Add new field to existing content type.

Proposed resolution

The thing is there is no re-throw statement at field_ui.admin.inc line 831 , just

catch (Exception $e)
{
drupal_set_message(t('There was a problem creating field %label: !message', array('%label' => $instance['label'], '!message' => $e->getMessage())), 'error');
}

Adding

throw $e; 

to the scope will do so the exception is handled and logged by other modules down the stack.

CommentFileSizeAuthor
Error-page.png62.25 KBfeoff
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Version: 7.24 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.