Hi!
I am using WWW to send tweets (to Twitter, obviously). While it works when everything goes well, I cannot manage to deal with WWW error properly when an error happens (i.e. wrong username or no connection). I’m using the well known TwitterSend function. The error is always null, even when I know for sure that, for example, the password is wrong.
The following function always prints “Twitter posting done!” even if there is a known error during posting:
function TwitterSend(username: String, password: String, message: String) {
var twitterURL: String = "http://" + username + ":" + password + "@twitter.com/statuses/update.json";
var twitterForm : WWWForm = new WWWForm();
twitterForm.AddField("status", message);
var WWWpost : WWW = new WWW(twitterURL, twitterForm);
print("Tweeting...");
yield WWWpost;
print("Done...");
if (WWWpost.error != null) {
print ( "Twitter posting error...");
} else {
print ( "Twitter posting done!");
}
}
Am I doing something wrong?