Friday, July 22, 2011

[YouTube-API] Viewing response codes

                Im curious how to receive a response code other than try-catch to catch the exception thats thrown and view the exception message.  This is how i have to do it currently and ide like to be able to see success responses and not limit myself to just receiving exceptions thrown.:

       try
                Dim settings = New YouTubeRequestSettings('settings here')
                Dim request = New YouTubeRequest(settings)
                Dim videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/" & videoid
                Dim videoentry = New YouTubeEntry
                videoentry = request.Service.Get(videoEntryUrl)
                request.Service.Insert(New Uri("http://gdata.youtube.com/feeds/api/users/default/favorites"), videoentry)
     Catch ex As Exception
                If ex.Message = "Invalid credentials" Or ex.Message = "Account disabled" Then
                    _BadAcc = True
                End If
                _NavFailed = True
                mainform.BackgroundWorker1.ReportProgress(0, "Youtube's error message: " & ex.Message)
            End Try

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/SHrGKrj8egcJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment