From 8bd4ae27c2600c6f65adede75009f4d0f3874396 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Wed, 19 Nov 2014 19:43:32 +0100 Subject: [PATCH] Fixed bad message when serving non-existing files --- src/Services/NetworkingService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Services/NetworkingService.php b/src/Services/NetworkingService.php index 6455d0d1..b7777f57 100644 --- a/src/Services/NetworkingService.php +++ b/src/Services/NetworkingService.php @@ -14,6 +14,9 @@ class NetworkingService public function serveFile($fullPath, $customFileName = null) { + if (!file_exists($fullPath)) + throw new \Exception('File "' . $fullPath . '" does not exist.'); + $daysToLive = 7; $secondsToLive = $daysToLive * 24 * 60 * 60; $lastModified = filemtime($fullPath);