throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
_uname = username.ToLower();
if (SettingCommon.Instance.UserstreamStartup) this.ReconnectUserStream();
throw new WebApiException("Err:Failed to access auth acc server.", ex);
}
- var err = this.CheckStatusCode(res, null);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, null);
_uname = Username.ToLower();
if (SettingCommon.Instance.UserstreamStartup) this.ReconnectUserStream();
if (res == HttpStatusCode.NotFound)
return;
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterStatus status;
try
if (res == HttpStatusCode.NotFound)
return;
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterStatus status;
try
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterUploadMediaResult status;
try
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterDirectMessage status;
try
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, null);
- if (!string.IsNullOrEmpty(err))
- throw new WebApiException(err);
+ this.CheckStatusCode(res, null);
}
public void PostRetweet(long id, bool read)
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterStatus status;
try
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, null);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, null);
}
public void PostFollowCommand(string screenName)
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public void PostRemoveCommand(string screenName)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public void PostCreateBlock(string screenName)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public void PostDestroyBlock(string screenName)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public void PostReportSpam(string screenName)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public TwitterFriendship GetFriendshipInfo(string screenName)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
if (!_restrictFavCheck)
return;
throw new WebApiException("Err:" + ex.Message, ex);
}
- err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterStatus status;
try
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public TwitterUser PostUpdateProfile(string name, string url, string location, string description)
throw new WebApiException("Err:" + ex.Message, content, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err, content);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public string Username
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
var minimumId = CreatePostsFromJson(content, gType, null, read);
if (res == HttpStatusCode.Unauthorized)
throw new WebApiException("Err:@" + userName + "'s Tweets are protected.");
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
var minimumId = CreatePostsFromJson(content, MyCommon.WORKERTYPE.UserTimeline, tab, read);
if (res == HttpStatusCode.Forbidden)
throw new WebApiException("Err:protected user's tweet", content);
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
TwitterStatus status;
try
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
var minimumId = CreatePostsFromJson(content, MyCommon.WORKERTYPE.List, tab, read);
throw new WebApiException("Err:" + ex.Message, ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
CreateDirectMessagesFromJson(content, gType, read);
}
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
CreateFavoritePostsFromJson(content, read);
}
throw new WebApiException("Err:" + e.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", e);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err, content);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + e.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", e);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err, content);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + e.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", e);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err, content);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public ListElement EditList(string list_id, string new_name, bool isPrivate, string description)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
return false;
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
public void RemoveUserToList(string listId, string user)
throw new WebApiException("Err:" + ex.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", ex);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
}
private class range
return null;
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err);
+ this.CheckStatusCode(res, content);
try
{
throw new WebApiException("Err:" + e.Message + "(" + MethodBase.GetCurrentMethod().Name + ")", e);
}
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err, content);
+ this.CheckStatusCode(res, content);
try
{
var res = await Task.Run(() => twCon.GetMuteUserIds(ref content, cursor))
.ConfigureAwait(false);
- var err = this.CheckStatusCode(res, content);
- if (err != null)
- throw new WebApiException(err, content);
+ this.CheckStatusCode(res, content);
return TwitterIds.ParseJson(content);
}
}
}
- private string CheckStatusCode(HttpStatusCode httpStatus, string responseText,
+ private void CheckStatusCode(HttpStatusCode httpStatus, string responseText,
[CallerMemberName] string callerMethodName = "")
{
if (httpStatus == HttpStatusCode.OK)
{
Twitter.AccountState = MyCommon.ACCOUNT_STATE.Valid;
- return null;
+ return;
}
if (string.IsNullOrWhiteSpace(responseText))
if (httpStatus == HttpStatusCode.Unauthorized)
Twitter.AccountState = MyCommon.ACCOUNT_STATE.Invalid;
- return "Err:" + httpStatus + "(" + callerMethodName + ")";
+ throw new WebApiException("Err:" + httpStatus + "(" + callerMethodName + ")");
}
try
var errors = TwitterError.ParseJson(responseText).Errors;
if (errors == null || !errors.Any())
{
- return "Err:" + httpStatus + "(" + callerMethodName + ")";
+ throw new WebApiException("Err:" + httpStatus + "(" + callerMethodName + ")", responseText);
}
foreach (var error in errors)
}
}
- return "Err:" + string.Join(",", errors.Select(x => x.ToString())) + "(" + callerMethodName + ")";
+ throw new WebApiException("Err:" + string.Join(",", errors.Select(x => x.ToString())) + "(" + callerMethodName + ")", responseText);
}
catch (SerializationException) { }
- return "Err:" + httpStatus + "(" + callerMethodName + ")";
+ throw new WebApiException("Err:" + httpStatus + "(" + callerMethodName + ")", responseText);
}
#region "UserStream"