Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.764
diff -u -p -r1.764 common.inc
--- includes/common.inc	14 Apr 2008 17:48:33 -0000	1.764
+++ includes/common.inc	5 May 2008 20:48:43 -0000
@@ -3081,14 +3081,19 @@ function drupal_get_schema($table = NULL
  *      query: the SQL query(s) executed, passed through check_plain()
  */
 function drupal_install_schema($module) {
-  $schema = drupal_get_schema_unprocessed($module);
-  _drupal_initialize_schema($module, $schema);
-
-  $ret = array();
-  foreach ($schema as $name => $table) {
-    db_create_table($ret, $name, $table);
+  try {
+    $schema = drupal_get_schema_unprocessed($module);
+    _drupal_initialize_schema($module, $schema);
+
+    $ret = array();
+    foreach ($schema as $name => $table) {
+      db_create_table($ret, $name, $table);
+    }
+    return $ret;
+  }
+  catch (Exception $error) {
+    drupal_set_message(t('Error: @error', array('@error' => $error)), 'error');
   }
-  return $ret;
 }
 
 /**
@@ -3106,14 +3111,19 @@ function drupal_install_schema($module) 
  *      query: the SQL query(s) executed, passed through check_plain()
  */
 function drupal_uninstall_schema($module) {
-  $schema = drupal_get_schema_unprocessed($module);
-  _drupal_initialize_schema($module, $schema);
-
-  $ret = array();
-  foreach ($schema as $table) {
-    db_drop_table($ret, $table['name']);
+  try {
+    $schema = drupal_get_schema_unprocessed($module);
+    _drupal_initialize_schema($module, $schema);
+
+    $ret = array();
+    foreach ($schema as $table) {
+      db_drop_table($ret, $table['name']);
+    }
+    return $ret;
+  }
+  catch (Exception $error) {
+    drupal_set_message(t('Error: @error', array('@error' => $error)), 'error');
   }
-  return $ret;
 }
 
 /**
@@ -3143,7 +3153,9 @@ function drupal_uninstall_schema($module
 function drupal_get_schema_unprocessed($module, $table = NULL) {
   // Load the .install file to get hook_schema.
   module_load_include('install', $module);
-  $schema = module_invoke($module, 'schema');
+  if (!$schema = module_invoke($module, 'schema')) {
+    throw new Exception(t("@module_schema() doesn't exist.", array('@module' => $module)));
+  }
 
   if (!is_null($table) && isset($schema[$table])) {
     return $schema[$table];
