details on fail

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/952/head
Maxence Lange 2020-07-27 20:02:09 -01:00
rodzic b91f94b32e
commit 7862780eaf
2 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -358,8 +358,8 @@ class ActivityPubController extends Controller {
*
* @return Response
* @throws SocialAppConfigException
* @throws StreamNotFoundException
* @throws UrlCloudException
* @throws StreamNotFoundException
*/
public function displayPost(string $username, string $token): Response {
try {
@ -378,7 +378,11 @@ class ActivityPubController extends Controller {
}
$postId = $this->configService->getSocialUrl() . '@' . $username . '/' . $token;
$stream = $this->streamService->getStreamById($postId, true);
try {
$stream = $this->streamService->getStreamById($postId, true);
} catch (StreamNotFoundException $e) {
return $this->fail($e, ['stream' => $postId], Http::STATUS_NOT_FOUND);
}
$stream->setCompleteDetails(false);

Wyświetl plik

@ -254,9 +254,7 @@ class StreamRequest extends StreamRequestBuilder {
} catch (ItemUnknownException $e) {
throw new StreamNotFoundException('Malformed Stream');
} catch (StreamNotFoundException $e) {
throw new StreamNotFoundException(
'Stream (ById) not found - ' . $id . ' (asViewer: ' . $asViewer . ')'
);
throw new StreamNotFoundException('Stream not found');
}
}