]>
Commit | Line | Data |
---|---|---|
b2306b0c | 1 | <?php |
f3d2f257 V |
2 | namespace Shaarli\Exceptions; |
3 | ||
4 | use Exception; | |
b2306b0c A |
5 | |
6 | /** | |
7 | * Exception class thrown when a filesystem access failure happens | |
8 | */ | |
9 | class IOException extends Exception | |
10 | { | |
11 | private $path; | |
12 | ||
13 | /** | |
14 | * Construct a new IOException | |
15 | * | |
16 | * @param string $path path to the resource that cannot be accessed | |
17 | * @param string $message Custom exception message. | |
18 | */ | |
19 | public function __construct($path, $message = '') | |
20 | { | |
21 | $this->path = $path; | |
12266213 | 22 | $this->message = empty($message) ? t('Error accessing') : $message; |
f3d2f257 | 23 | $this->message .= ' "' . $this->path . '"'; |
b2306b0c A |
24 | } |
25 | } |