summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-09-29 17:25:52 -0400
committerEvan Prodromou <evan@status.net>2009-09-29 17:25:52 -0400
commit89ac81c34464b2fc4f54b643d0d95d12bac765ab (patch)
tree4e3277cb5ad9d93a61262f004a82efc14eaf7d30 /lib
parent0a57d1ccee1af8570d4c83934d9ab99fa1a1dc37 (diff)
remove string-checks from code using Notice::saveNew()
Diffstat (limited to 'lib')
-rw-r--r--lib/facebookaction.php10
-rw-r--r--lib/oauthstore.php5
2 files changed, 6 insertions, 9 deletions
diff --git a/lib/facebookaction.php b/lib/facebookaction.php
index 411f79594..3f3a8d3b0 100644
--- a/lib/facebookaction.php
+++ b/lib/facebookaction.php
@@ -468,11 +468,11 @@ class FacebookAction extends Action
$replyto = $this->trimmed('inreplyto');
- $notice = Notice::saveNew($user->id, $content,
- 'web', 1, ($replyto == 'false') ? null : $replyto);
-
- if (is_string($notice)) {
- $this->showPage($notice);
+ try {
+ $notice = Notice::saveNew($user->id, $content,
+ 'web', 1, ($replyto == 'false') ? null : $replyto);
+ } catch (Exception $e) {
+ $this->showPage($e->getMessage());
return;
}
diff --git a/lib/oauthstore.php b/lib/oauthstore.php
index e69a00f55..d617a7df7 100644
--- a/lib/oauthstore.php
+++ b/lib/oauthstore.php
@@ -156,7 +156,6 @@ class StatusNetOAuthDataStore extends OAuthDataStore
return $this->new_access_token($consumer);
}
-
/**
* Revoke specified OAuth token
*
@@ -363,9 +362,7 @@ class StatusNetOAuthDataStore extends OAuthDataStore
false,
null,
$omb_notice->getIdentifierURI());
- if (is_string($notice)) {
- throw new Exception($notice);
- }
+
common_broadcast_notice($notice, true);
}