diff --git a/task.hosting.inc b/task.hosting.inc
index 1a447bd..9def9ed 100644
--- a/task.hosting.inc
+++ b/task.hosting.inc
@@ -136,10 +136,12 @@ function drush_hosting_task() {
   if ($code) {
     $task->task_status = HOSTING_TASK_ERROR;
   }
-  elseif ($warning) {
+  // The status may have been updated already, in which case, we don't want to
+  // downgrade the error code. See: hosting_task_log().
+  elseif ($warning && $task->task_status != HOSTING_TASK_ERROR) {
     $task->task_status = HOSTING_TASK_WARNING;
   }
-  else {
+  elseif ($task->task_status != HOSTING_TASK_WARNING) {
     $task->task_status = HOSTING_TASK_SUCCESS;
   }
 
diff --git a/task/hosting_task.module b/task/hosting_task.module
index 0c00714..ba80d6e 100644
--- a/task/hosting_task.module
+++ b/task/hosting_task.module
@@ -322,6 +322,19 @@ function hosting_task_log($vid, $type, $message, $error = '', $timestamp = NULL)
   }
 
   db_query("INSERT INTO {hosting_task_log} (vid, nid, type, message, error, timestamp) VALUES (%d, %d, '%s', '%s', '%s', %d)", $vid, $nids[$vid], $type, $message, $error, $timestamp);
+
+  if ($type == 'error' || $type == 'warning') {
+    $status = (int)db_result(db_query('SELECT task_status FROM {hosting_task} WHERE vid = %d', $vid));
+    // Don't override a pre-existing error
+    if ($status != HOSTING_TASK_ERROR && $type == 'warning') {
+      $update = HOSTING_TASK_WARNING;
+    }
+    else {
+      $update = HOSTING_TASK_ERROR;
+    }
+    db_query('UPDATE {hosting_task} SET task_status=%d WHERE vid = %d', $update, $vid);
+  }
+
 }
 
 /**
