summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2020-07-27 20:02:09 -0100
committerMaxence Lange <maxence@artificial-owl.com>2020-07-27 20:02:09 -0100
commit7862780eaf299937a29bfe2aef58f0d592a60775 (patch)
treef681f7663fad7df064d032f7e866b2b2360e550a
parentb91f94b32e76d7f1007f3e47d66b1ac06cde6a91 (diff)
details on fail
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/Controller/ActivityPubController.php8
-rw-r--r--lib/Db/StreamRequest.php4
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/Controller/ActivityPubController.php b/lib/Controller/ActivityPubController.php
index ac4b4d28..2714eb21 100644
--- a/lib/Controller/ActivityPubController.php
+++ b/lib/Controller/ActivityPubController.php
@@ -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);
diff --git a/lib/Db/StreamRequest.php b/lib/Db/StreamRequest.php
index 0a50c1a3..8591eeaf 100644
--- a/lib/Db/StreamRequest.php
+++ b/lib/Db/StreamRequest.php
@@ -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');
}
}