diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-01-16 12:30:18 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-21 20:16:26 +0100 |
commit | b2306b0c783365e3f8110ae25bc93f2630b8b2c8 (patch) | |
tree | 746c41d42d3230e05839fa2631e78b9e283b33ad /application/exceptions/IOException.php | |
parent | c4c655d9bfe68a914898d76bb9c479eea1b04f72 (diff) | |
download | Shaarli-b2306b0c783365e3f8110ae25bc93f2630b8b2c8.tar.gz Shaarli-b2306b0c783365e3f8110ae25bc93f2630b8b2c8.tar.zst Shaarli-b2306b0c783365e3f8110ae25bc93f2630b8b2c8.zip |
Move database read/write to FileUtils class + additional unit tests
Diffstat (limited to 'application/exceptions/IOException.php')
-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 | } | ||