started improving exception handling

This commit is contained in:
Jonathan Treffler 2023-09-20 22:53:02 +02:00 committed by root
parent 1756d541ca
commit 2b64e8969a
2 changed files with 18 additions and 3 deletions

View file

@ -0,0 +1,14 @@
<?php
namespace OCA\GroupfolderFilesystemSnapshots\Exceptions;
class NotFoundException extends \RuntimeException {
public function __construct($entity, array|string $criteria) {
$message = sprintf(
"Could not find %s with criteria %s",
class_exists($entity) ? array_pop(explode('\\', $entity)) : $entity,
is_string($criteria) ? $criteria : json_encode($criteria),
);
parent::__construct($message);
}
}