mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-12-06 11:22:41 +01:00
added not found errors to be used by organization providers
This commit is contained in:
parent
38b1406d40
commit
2521a35b2a
6 changed files with 46 additions and 2 deletions
14
lib/Errors/NotFoundException.php
Normal file
14
lib/Errors/NotFoundException.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\OrganizationFolders\Errors;
|
||||
|
||||
abstract 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