summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArron Woods <aw@chartblocks.com>2015-04-23 17:07:50 +0100
committerArron Woods <aw@chartblocks.com>2015-04-23 17:07:50 +0100
commitcd410f6a2305a2b025ab50e3c172dc36bb8c38ec (patch)
treebeebf5370073a37c74f15b9a51ceba41f14e8df4
parenta12d873a6a8230dd2ef1255fedd5753068ce86ee (diff)
downloadphp-ssrs-cd410f6a2305a2b025ab50e3c172dc36bb8c38ec.zip
php-ssrs-cd410f6a2305a2b025ab50e3c172dc36bb8c38ec.tar.gz
php-ssrs-cd410f6a2305a2b025ab50e3c172dc36bb8c38ec.tar.bz2
HTTP exception1.0.9
-rw-r--r--library/SSRS/Report/CachedStreamResource.php4
-rw-r--r--library/SSRS/Report/HttpUserException.php7
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 {
+
+}