]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/activityimporter.php
Make Profile::fromUri use UnknownUriException
[quix0rs-gnu-social.git] / lib / activityimporter.php
index 27f89225c2ba93ac49d30f1bace8d6ad61572a5c..8846831b9062205532a0cdd65a7a1ae00ff1d73a 100644 (file)
@@ -115,10 +115,11 @@ class ActivityImporter extends QueueHandler
 
             $other = $activity->objects[0];
 
-            $otherProfile = Profile::fromUri($other->id);
-
-            if (empty($otherProfile)) {
+            try {
+                $otherProfile = Profile::fromUri($other->id);
                 // TRANS: Client exception thrown when trying to subscribe to an unknown profile.
+            } catch (UnknownUriException $e) {
+                // Let's convert it to a client exception instead of server.
                 throw new ClientException(_('Unknown profile.'));
             }