Skip to content

Commit ba5ef5d

Browse files
committed
Always log the Twitter response body
1 parent 6f8c296 commit ba5ef5d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

source/dlangbot/twitter.d

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void tweet(string message)
1313
parameters["status"] = message;
1414
logInfo("Sending tweet: %s", message);
1515
scope res = twitterRequest("/statuses/update.json", parameters);
16-
logInfo("Tweet sent: %d, %s", res.statusCode, res.statusPhrase);
16+
//logInfo("Tweet sent: %d, %s", res.statusCode, res.statusPhrase);
1717
}
1818

1919
// send a signed request with the Twitter API
@@ -31,11 +31,7 @@ auto twitterRequest(string path, OAuth.Parameters parameters, HTTPMethod method
3131
req.method = method;
3232
req.headers["Authorization"] = oAuth.requestHeader(url, method.to!string, parameters);
3333
});
34-
if (res.statusCode / 100 != 2)
35-
logInfo("%s %s, %s - %s\n", method, url, res.statusPhrase, res.bodyReader.readAllUTF8);
36-
else
37-
res.dropBody;
38-
34+
logInfo("%s %s, %s - %s\n", method, url, res.statusPhrase, res.bodyReader.readAllUTF8);
3935
return res;
4036
}
4137

0 commit comments

Comments
 (0)