Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.922
diff -u -r1.922 common.inc
--- includes/common.inc	13 Jun 2009 19:28:57 -0000	1.922
+++ includes/common.inc	14 Jun 2009 06:07:55 -0000
@@ -3393,7 +3393,11 @@
     variable_set('cron_semaphore', REQUEST_TIME);
 
     // Iterate through the modules calling their cron handlers (if any):
-    module_invoke_all('cron');
+    try {
+      module_invoke_all('cron');
+    } catch (Exception $e) {
+      watchdog('cron', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR);
+    }
 
     // Record cron time
     variable_set('cron_last', REQUEST_TIME);
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.46
diff -u -r1.46 common.test
--- modules/simpletest/tests/common.test	12 Jun 2009 08:39:39 -0000	1.46
+++ modules/simpletest/tests/common.test	14 Jun 2009 06:07:57 -0000
@@ -748,6 +748,35 @@
 }
 
 /**
+ * Tests Drupal error and exception handlers.
+ */
+class DrupalCronExceptionTest extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => t('Cron exception'),
+      'description' => t('Performs tests on the Drupal cron exceptions.'),
+      'group' => t('System'),
+    );
+  }
+
+  function setUp() {
+    parent::setUp('cron_test');
+  }
+
+  function testCronException() {
+    drupal_cron_run();
+    $count = db_select('watchdog', 'w')
+      ->condition('type', 'cron')
+      ->condition('message', 'Cron is in trouble.')
+      ->condition('severity', WATCHDOG_ERROR)
+      ->countQuery()
+      ->execute()
+      ->fetchField();
+    $this->assertTrue($count > 0, t('watchdog table contains @count rows for cron exceptions.', array('@count' => $count)));
+  }
+}
+
+/**
  * Tests for CRUD API functions.
  */
 class DrupalDataApiTest extends DrupalWebTestCase {
Index: modules/simpletest/tests/cron_test.info
===================================================================
RCS file: modules/simpletest/tests/cron_test.info
diff -N modules/simpletest/tests/cron_test.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/cron_test.info	14 Jun 2009 06:07:57 -0000
@@ -0,0 +1,8 @@
+; $Id$
+name = "Cron exception test"
+description = "Support module for cron exception testing."
+package = Testing
+version = VERSION
+core = 7.x
+files[] = cron_test.module
+hidden = TRUE
Index: modules/simpletest/tests/cron_test.module
===================================================================
RCS file: modules/simpletest/tests/cron_test.module
diff -N modules/simpletest/tests/cron_test.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/simpletest/tests/cron_test.module	14 Jun 2009 06:07:57 -0000
@@ -0,0 +1,9 @@
+<?php
+// $Id$
+
+/**
+ * Implement hook_cron().
+ */
+function cron_test_cron() {
+  throw new Exception("Cron is in trouble.");
+}
