diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-05-06 17:12:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-06 17:12:06 +0200 |
commit | f9ff7f1b69f19b42569ffa67280807ba56f5d48a (patch) | |
tree | 22126f1de7aac6c03a0b2c609380057740b840ac /application/exceptions | |
parent | a271c5f34f99bab38a167d491b69e5942cd6da94 (diff) | |
parent | d16ca2e22f3d7325fc9593fccd8523eebe226567 (diff) | |
download | Shaarli-f9ff7f1b69f19b42569ffa67280807ba56f5d48a.tar.gz Shaarli-f9ff7f1b69f19b42569ffa67280807ba56f5d48a.tar.zst Shaarli-f9ff7f1b69f19b42569ffa67280807ba56f5d48a.zip |
Merge pull request #764 from ArthurHoaro/feature/history
History mechanism
Diffstat (limited to 'application/exceptions')
-rw-r--r-- | application/exceptions/IOException.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/application/exceptions/IOException.php b/application/exceptions/IOException.php new file mode 100644 index 00000000..b563b23d --- /dev/null +++ b/application/exceptions/IOException.php | |||
@@ -0,0 +1,22 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Exception class thrown when a filesystem access failure happens | ||
5 | */ | ||
6 | class IOException extends Exception | ||
7 | { | ||
8 | private $path; | ||
9 | |||
10 | /** | ||
11 | * Construct a new IOException | ||
12 | * | ||
13 | * @param string $path path to the resource that cannot be accessed | ||
14 | * @param string $message Custom exception message. | ||
15 | */ | ||
16 | public function __construct($path, $message = '') | ||
17 | { | ||
18 | $this->path = $path; | ||
19 | $this->message = empty($message) ? 'Error accessing' : $message; | ||
20 | $this->message .= ' "' . $this->path .'"'; | ||
21 | } | ||
22 | } | ||