diff options
-rw-r--r-- | library/SSRS/Report/CachedStreamResource.php | 4 | ||||
-rw-r--r-- | library/SSRS/Report/HttpUserException.php | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/library/SSRS/Report/CachedStreamResource.php b/library/SSRS/Report/CachedStreamResource.php index 08e9dbb..013eaee 100644 --- a/library/SSRS/Report/CachedStreamResource.php +++ b/library/SSRS/Report/CachedStreamResource.php @@ -15,6 +15,10 @@ class CachedStreamResource { } public function read() { + if (false === file_exists($this->filePath)) { + throw new HttpUserException('Resource file not found', 404); + } + $data = file_get_contents($this->filePath); $parts = explode("\n", $data, 2); diff --git a/library/SSRS/Report/HttpUserException.php b/library/SSRS/Report/HttpUserException.php new file mode 100644 index 0000000..2010cf5 --- /dev/null +++ b/library/SSRS/Report/HttpUserException.php @@ -0,0 +1,7 @@ +<?php + +namespace SSRS\Report; + +class HttpUserException extends Exception { + +} |