summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-17 19:24:38 +0000
committerZach Copley <zach@status.net>2010-02-17 19:24:38 +0000
commit6b887728b2c84fec39a576e6f2a76909b6318774 (patch)
tree86c220cc3c98305496f1959d031736df98edb05e /plugins/TwitterBridge
parent3cb6b1670bd7e3860fdca217e4075f51378fe5e0 (diff)
Better logging for Twitter bridge account linking process
Diffstat (limited to 'plugins/TwitterBridge')
-rw-r--r--plugins/TwitterBridge/twitterauthorization.php31
1 files changed, 22 insertions, 9 deletions
diff --git a/plugins/TwitterBridge/twitterauthorization.php b/plugins/TwitterBridge/twitterauthorization.php
index c154932bb..8bfdacee9 100644
--- a/plugins/TwitterBridge/twitterauthorization.php
+++ b/plugins/TwitterBridge/twitterauthorization.php
@@ -131,8 +131,7 @@ class TwitterauthorizationAction extends Action
} else if ($this->arg('connect')) {
$this->connectNewUser();
} else {
- common_debug('Twitter Connect Plugin - ' .
- print_r($this->args, true));
+ common_debug('Twitter bridge - ' . print_r($this->args, true));
$this->showForm(_('Something weird happened.'),
$this->trimmed('newname'));
}
@@ -172,9 +171,15 @@ class TwitterauthorizationAction extends Action
$auth_link = $client->getAuthorizeLink($req_tok, $this->signin);
} catch (OAuthClientException $e) {
- $msg = sprintf('OAuth client error - code: %1s, msg: %2s',
- $e->getCode(), $e->getMessage());
- $this->serverError(_m('Couldn\'t link your Twitter account.'));
+ $msg = sprintf(
+ 'OAuth client error - code: %1s, msg: %2s',
+ $e->getCode(),
+ $e->getMessage()
+ );
+ common_log(LOG_INFO, 'Twitter bridge - ' . $msg);
+ $this->serverError(
+ _m('Couldn\'t link your Twitter account: ') . $e->getMessage()
+ );
}
common_redirect($auth_link);
@@ -192,7 +197,9 @@ class TwitterauthorizationAction extends Action
// token we sent them
if ($_SESSION['twitter_request_token'] != $this->oauth_token) {
- $this->serverError(_m('Couldn\'t link your Twitter account.'));
+ $this->serverError(
+ _m('Couldn\'t link your Twitter account: oauth_token mismatch.')
+ );
}
$twitter_user = null;
@@ -212,9 +219,15 @@ class TwitterauthorizationAction extends Action
$twitter_user = $client->verifyCredentials();
} catch (OAuthClientException $e) {
- $msg = sprintf('OAuth client error - code: %1$s, msg: %2$s',
- $e->getCode(), $e->getMessage());
- $this->serverError(_m('Couldn\'t link your Twitter account.'));
+ $msg = sprintf(
+ 'OAuth client error - code: %1$s, msg: %2$s',
+ $e->getCode(),
+ $e->getMessage()
+ );
+ common_log(LOG_INFO, 'Twitter bridge - ' . $msg);
+ $this->serverError(
+ _m('Couldn\'t link your Twitter account: ') . $e-getMessage()
+ );
}
if (common_logged_in()) {