diff options
Diffstat (limited to 'lib/exceptions/NotFoundException.php')
| -rw-r--r-- | lib/exceptions/NotFoundException.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/exceptions/NotFoundException.php b/lib/exceptions/NotFoundException.php new file mode 100644 index 0000000..d1ed900 --- /dev/null +++ b/lib/exceptions/NotFoundException.php @@ -0,0 +1,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; + } +} |
