From 2276295fd633482032d6125c22b84e6c8b9d020a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 3 Jun 2010 13:08:52 +0000 Subject: - Patch #816642 by catch: improved field exceptions. --- modules/field/field.crud.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc index 3de0963bf..f49972248 100644 --- a/modules/field/field.crud.inc +++ b/modules/field/field.crud.inc @@ -704,14 +704,14 @@ function field_update_instance($instance) { // Check that the specified field exists. $field = field_read_field($instance['field_name']); if (empty($field)) { - throw new FieldException("Attempt to update an instance of a nonexistent field."); + throw new FieldException(t('Attempt to update an instance of a nonexistent field @field.', array('@field' => $instance['field_name']))); } // Check that the field instance exists (even if it is inactive, since we // want to be able to replace inactive widgets with new ones). $prior_instance = field_read_instance($instance['entity_type'], $instance['field_name'], $instance['bundle'], array('include_inactive' => TRUE)); if (empty($prior_instance)) { - throw new FieldException("Attempt to update a field instance that doesn't exist."); + throw new FieldException(t("Attempt to update an instance of field @field on bundle @bundle that doesn't exist.", array('@field' => $instance['field_name'], '@bundle' => $instance['bundle']))); } $instance['id'] = $prior_instance['id']; -- cgit v1.2.3