public class ApiException : Exception
{
public Uri FailingService { get; protected set; }
public ApiException(Uri failedURI) { this.FailingService = failedURI; }
} // ApiException
string apiurl = "http://failedapi";
try
{
// вызов API
}
catch (Exception ex)
{
throw new ApiException(new Uri(apiurl));
}