Example usage for twitter4j TwitterException toString

List of usage examples for twitter4j TwitterException toString

Introduction

In this page you can find the example usage for twitter4j TwitterException toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:net.lacolaco.smileessence.twitter.task.RequestTokenTask.java

License:Open Source License

@Override
protected RequestToken doInBackground(Void... params) {
    try {//from w  w  w . j a v a  2 s  . c  om
        return twitter.getOAuthRequestToken();
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.RetweetTask.java

License:Open Source License

@Override
protected twitter4j.Status doInBackground(Void... params) {
    try {/*ww w.j a va 2 s. co m*/
        return twitter.tweets().retweetStatus(statusID);
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.SendMessageTask.java

License:Open Source License

@Override
protected DirectMessage doInBackground(Void... params) {
    try {//from  w  w w . j a va 2  s . c  o m
        return twitter.directMessages().sendDirectMessage(userID, text);
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.SentDirectMessagesTask.java

License:Open Source License

@Override
protected DirectMessage[] doInBackground(Void... params) {
    ResponseList<DirectMessage> responseList;
    try {//from w  ww .j  av  a  2  s . co  m
        if (paging == null) {
            responseList = twitter.directMessages().getSentDirectMessages();
        } else {
            responseList = twitter.directMessages().getSentDirectMessages(paging);
        }
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        if (e.exceededRateLimitation()) {
            Notificator.publish(activity, R.string.notice_error_rate_limit, NotificationType.ALERT);
        } else {
            Notificator.publish(activity, R.string.notice_error_get_messages, NotificationType.ALERT);
        }
        return new DirectMessage[0];
    }
    return responseList.toArray(new DirectMessage[responseList.size()]);
}

From source file:net.lacolaco.smileessence.twitter.task.ShowDirectMessageTask.java

License:Open Source License

@Override
protected DirectMessage doInBackground(Void... params) {
    try {/*from www  . j  ava  2  s.c  om*/
        return twitter.directMessages().showDirectMessage(messageID);
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.ShowFriendshipTask.java

License:Open Source License

@Override
protected Relationship doInBackground(Void... params) {
    try {//  w w w .  j  a  v a2 s.  c om
        if (screenName != null) {
            return twitter.friendsFollowers().showFriendship(twitter.getScreenName(), screenName);
        } else {
            return twitter.friendsFollowers().showFriendship(twitter.getId(), userID);
        }
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.ShowStatusTask.java

License:Open Source License

@Override
protected twitter4j.Status doInBackground(Void... params) {
    try {/*from   w  ww . ja  v a 2  s.  c  o  m*/
        return twitter.tweets().showStatus(id);
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.ShowUserTask.java

License:Open Source License

@Override
protected User doInBackground(Void... params) {
    try {//from w w  w . j av a2s .c  om
        if (screenName != null) {
            return twitter.users().showUser(screenName);
        } else {
            return twitter.users().showUser(userID);
        }
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.TweetTask.java

License:Open Source License

@Override
protected twitter4j.Status doInBackground(Void... params) {
    try {// www.j  av a 2 s  . com
        if (TextUtils.isEmpty(mediaPath)) {
            return twitter.tweets().updateStatus(update);
        } else {
            File mediaFile = getMediaFile();
            if (mediaFile.exists()) {
                update.setMedia(mediaFile);
            }
            twitter4j.Status status = twitter.tweets().updateStatus(update);
            if (tempFilePath != null) {
                new File(tempFilePath).delete();
            }
            return status;
        }
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}

From source file:net.lacolaco.smileessence.twitter.task.UnblockTask.java

License:Open Source License

@Override
protected User doInBackground(Void... params) {
    try {//from   ww  w.j  av a 2 s  . co  m
        return twitter.users().destroyBlock(userID);
    } catch (TwitterException e) {
        e.printStackTrace();
        Logger.error(e.toString());
        return null;
    }
}