catch missing actor

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/1658/head
Maxence Lange 2023-03-14 20:45:04 -01:00
rodzic eace45befb
commit 044c738989
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -34,6 +34,7 @@ use Exception;
use OCA\Social\AP;
use OCA\Social\Db\ActorsRequest;
use OCA\Social\Db\CacheActorsRequest;
use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\CacheActorDoesNotExistException;
use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\InvalidResourceException;
@ -177,6 +178,7 @@ class CacheActorService {
* @return Person
* @throws CacheActorDoesNotExistException
* @throws SocialAppConfigException
* @throws ActorDoesNotExistException
*/
public function getFromLocalAccount(string $account): Person {
$instance = '';

Wyświetl plik

@ -26,6 +26,7 @@ declare(strict_types=1);
namespace OCA\Social\WellKnown;
use OCA\Social\Db\CacheActorsRequest;
use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\CacheActorDoesNotExistException;
use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UnauthorizedFediverseException;
@ -109,7 +110,7 @@ class WebfingerHandler implements IHandler {
$actor = null;
try {
$actor = $this->cacheActorService->getFromLocalAccount($subject);
} catch (SocialAppConfigException $e) {
} catch (ActorDoesNotExistException | SocialAppConfigException $e) {
return null;
} catch (CacheActorDoesNotExistException $e) {
}