started improving exception handling
This commit is contained in:
parent
1756d541ca
commit
2b64e8969a
2 changed files with 18 additions and 3 deletions
14
lib/Exceptions/NotFoundException.php
Normal file
14
lib/Exceptions/NotFoundException.php
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue