I have the following code which is used to load video information from YouTube onto my site:
try {
$yt = new Zend_Gdata_YouTube();
$videoEntry = $yt->getVideoEntry($video_path);
$duration = $videoEntry->getVideoDuration();
} catch (Zend_Gdata_App_HttpException $e) {
//do something with the error
}
The problem I have is that I've detected, so far, 2 scenarios where the catch block will be executed - if the video has been removed, or if there is some sort of communication error.
If the video has been removed, I want to remove it from my local listing. How can I tell which error I'm getting - I've been looking for a description of the error codes, and can't find this, though I'm sure other people have run into this issue before.