WebException was unhandled by user code

Dec 14, 2010 at 6:47 PM

Hi Joe,

How can i handle WebExceptions like

i am unable to get following exceptions thrown by twitter like The remote server returned an error: (400) Bad Request.

try
{
 var ctx = new TwitterContext();
              
  var queryResults = (from search in ctx.Search
            where search.Type == SearchType.Search &&
            search.Query == searchTerm.Trim() &&
             search.PageSize == pageSize 
        select search).FirstOrDefault();

 foreach (var entry in queryResults.Entries)
            {
                  .......
            }

}

catch (TwitterQueryException ex) // or Exception class
              { 
                Console.WriteLine(ex.Message.ToString());
            }
regards
Shahid

Coordinator
Dec 15, 2010 at 2:36 AM

Hi Shahid,

This is a bug.  I'll add it to the issue list.

Thanks,

Joe

Coordinator
Dec 15, 2010 at 2:36 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.