From: Evan Prodromou <evan@status.net>
Date: Wed, 9 Feb 2011 08:08:52 +0000 (-0500)
Subject: ensure*() functions throw exceptions for errors
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=10500e7f85037d940c4730d94be0890ec8155665;p=quix0rs-gnu-social.git

ensure*() functions throw exceptions for errors
---

diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 13711d39f4..28f2dc0a97 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -1782,12 +1782,14 @@ class Ostatus_profile extends Memcached_DataObject
                     $oprofile = Ostatus_profile::ensureWebfinger($rest);
                     break;
                 default:
-                    common_log(LOG_WARNING,
-                               "Unrecognized URI protocol for profile: $protocol ($uri)");
+                    throw new ServerException("Unrecognized URI protocol for profile: $protocol ($uri)");
                     break;
                 }
+            } else {
+                throw new ServerException("No URI protocol for profile: ($uri)");
             }
         }
+
         return $oprofile;
     }