2017-01-16 12:30:18 +01:00
|
|
|
<?php
|
2020-09-22 20:25:47 +02:00
|
|
|
|
2018-12-02 23:31:40 +01:00
|
|
|
namespace Shaarli\Exceptions;
|
|
|
|
|
|
|
|
use Exception;
|
2017-01-16 12:30:18 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Exception class thrown when a filesystem access failure happens
|
|
|
|
*/
|
|
|
|
class IOException extends Exception
|
|
|
|
{
|
|
|
|
private $path;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a new IOException
|
|
|
|
*
|
|
|
|
* @param string $path path to the resource that cannot be accessed
|
|
|
|
* @param string $message Custom exception message.
|
|
|
|
*/
|
|
|
|
public function __construct($path, $message = '')
|
|
|
|
{
|
|
|
|
$this->path = $path;
|
2017-05-09 18:12:15 +02:00
|
|
|
$this->message = empty($message) ? t('Error accessing') : $message;
|
2018-12-02 23:31:40 +01:00
|
|
|
$this->message .= ' "' . $this->path . '"';
|
2017-01-16 12:30:18 +01:00
|
|
|
}
|
|
|
|
}
|