]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
FacebookBridge - make a huge fuss if we can't create a valid Facebookclient
authorZach Copley <zach@status.net>
Thu, 24 Feb 2011 20:52:31 +0000 (12:52 -0800)
committerZach Copley <zach@status.net>
Thu, 24 Feb 2011 20:52:31 +0000 (12:52 -0800)
plugins/FacebookBridge/lib/facebookclient.php

index 030a75caed1f084dde630a7a28b6ea9f077e09c1..80e333182420c42701de1121868e81c9d75bfdc5 100644 (file)
@@ -51,7 +51,14 @@ class Facebookclient
     function __construct($notice)
     {
         $this->facebook = self::getFacebook();
-        $this->notice   = $notice;
+
+        if (empty($this->facebook)) {
+            throw new FacebookApiException(
+                "Could not create Facebook client! Bad application ID or secret?"
+            );
+        }
+
+        $this->notice = $notice;
 
         $this->flink = Foreign_link::getByUserID(
             $notice->profile_id,
@@ -89,6 +96,22 @@ class Facebookclient
             $secret = common_config('facebook', 'global_secret');
         }
 
+        if (empty($appId)) {
+            common_log(
+                LOG_WARNING,
+                "Couldn't find Facebook application ID!",
+                __FILE__
+            );
+        }
+
+        if (empty($secret)) {
+            common_log(
+                LOG_WARNING,
+                "Couldn't find Facebook application ID!",
+                __FILE__
+            );
+        }
+
         return new Facebook(
             array(
                'appId'  => $appId,