Commit 65dbf485 authored by Zach Copley's avatar Zach Copley

FacebookBridge - make a huge fuss if we can't create a valid Facebookclient

parent 8eca1b8d
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment