aboutsummaryrefslogtreecommitdiff
path: root/lib/exceptions/NotFoundException.php
blob: d1ed9002f0257853686d331a88a3885c06dc4c3d (plain)
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
27
28
29
<?php
declare(strict_types=1);

class NotFoundException extends Exception
{
    private array $details = [];

    public function __construct(
        string $message = '',
        int $code = 0,
        ?Throwable $previous = null
    ) {
        parent::__construct(
            $message ?: _('Die angeforderte Ressource wurde nicht gefunden.'),
            $code ?: 404,
            $previous
        );
    }

    public function setDetails(array $details): void
    {
        $this->details = $details;
    }

    public function getDetails(): array
    {
        return $this->details;
    }
}