Files
TrainingAdvancedTechniques/Exceptionhandling/YouTubeApi.cs

29 lines
661 B
C#

using System;
using System.Collections.Generic;
namespace Exceptionhandling
{
public class YouTubeApi
{
public List<Video> GetVideos(string user)
{
try
{
// Access YouTube web interface
// Read the data
// Create a list of Video objects
throw new Exception("Ooops some low level YouTube error.");
}
catch (Exception ex)
{
//Log
throw new YouTubeException("Could not fetch the videos from YouTube.",ex);
}
return new List<Video>();
}
}
}