diff --git a/core/includes/file.inc b/core/includes/file.inc
index 858c4a6..e8f3706 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -549,15 +549,13 @@ function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXIST
 
   // Assert that the source file actually exists.
   if (!file_exists($source)) {
-    // @todo Replace drupal_set_message() calls with exceptions instead.
-    drupal_set_message(t('The specified file %file could not be copied because no file by that name exists. Please check that you supplied the correct filename.', array('%file' => $original_source)), 'error');
     if (($realpath = drupal_realpath($original_source)) !== FALSE) {
       $logger->notice('File %file (%realpath) could not be copied because it does not exist.', array('%file' => $original_source, '%realpath' => $realpath));
     }
     else {
       $logger->notice('File %file could not be copied because it does not exist.', array('%file' => $original_source));
     }
-    return FALSE;
+    throw new Exception(t('The specified file %file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.', array('%file' => $original_source)));
   }
 
   // Build a destination URI if necessary.
diff --git a/core/modules/system/src/Tests/File/UnmanagedCopyTest.php b/core/modules/system/src/Tests/File/UnmanagedCopyTest.php
index f525c1d..0bb23c6 100644
--- a/core/modules/system/src/Tests/File/UnmanagedCopyTest.php
+++ b/core/modules/system/src/Tests/File/UnmanagedCopyTest.php
@@ -52,9 +52,13 @@ function testNormal() {
   function testNonExistent() {
     // Copy non-existent file
     $desired_filepath = $this->randomMachineName();
-    $this->assertFalse(file_exists($desired_filepath), "Randomly named file doesn't exists.");
-    $new_filepath = file_unmanaged_copy($desired_filepath, $this->randomMachineName());
-    $this->assertFalse($new_filepath, 'Copying a missing file fails.');
+    $this->assertFalse(file_exists($desired_filepath), "Randomly named file doesn't exist.");
+    try {
+      file_unmanaged_copy($desired_filepath, $this->randomMachineName());
+    }
+    catch (\Exception $e) {
+      $this->assertTrue($e->getMessage(), 'Copying a missing file fails.');
+    }
   }
 
   /**
diff --git a/core/modules/system/src/Tests/File/UnmanagedMoveTest.php b/core/modules/system/src/Tests/File/UnmanagedMoveTest.php
index ea39c54..9d33cda 100644
--- a/core/modules/system/src/Tests/File/UnmanagedMoveTest.php
+++ b/core/modules/system/src/Tests/File/UnmanagedMoveTest.php
@@ -52,8 +52,12 @@ function testNormal() {
    */
   function testMissing() {
     // Move non-existent file.
-    $new_filepath = file_unmanaged_move($this->randomMachineName(), $this->randomMachineName());
-    $this->assertFalse($new_filepath, 'Moving a missing file fails.');
+    try {
+      file_unmanaged_move($this->randomMachineName(), $this->randomMachineName());
+    }
+    catch (\Exception $e) {
+      $this->assertTrue($e->getMessage(), 'Moving a missing file fails.');
+    }
   }
 
   /**
