diff options
author | Arron Woods <aw@chartblocks.com> | 2015-04-23 17:07:50 +0100 |
---|---|---|
committer | Arron Woods <aw@chartblocks.com> | 2015-04-23 17:07:50 +0100 |
commit | cd410f6a2305a2b025ab50e3c172dc36bb8c38ec (patch) | |
tree | beebf5370073a37c74f15b9a51ceba41f14e8df4 | |
parent | a12d873a6a8230dd2ef1255fedd5753068ce86ee (diff) | |
download | php-ssrs-cd410f6a2305a2b025ab50e3c172dc36bb8c38ec.zip php-ssrs-cd410f6a2305a2b025ab50e3c172dc36bb8c38ec.tar.gz php-ssrs-cd410f6a2305a2b025ab50e3c172dc36bb8c38ec.tar.bz2 |
HTTP exception1.0.9
-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 { + +} |