aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/exceptions/IOException.php
blob: c1a9ffbe5bd41ac09dba84f3e6eb1132bce75706 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace Shaarli\Exceptions;

use Exception;

/**
 * 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;
        $this->message = empty($message) ? t('Error accessing') : $message;
        $this->message .= ' "' . $this->path . '"';
    }
}