hardcoded search error messages changed to string resources
This commit is contained in:
@@ -58,7 +58,8 @@ namespace VDownload.Sources
|
||||
return await mapping.Service.SearchVideo(url);
|
||||
}
|
||||
}
|
||||
throw new MediaSearchException("Source is not supported"); // TODO : Change to string resource
|
||||
|
||||
throw CreateExceptionSourceNotSupported();
|
||||
}
|
||||
|
||||
public async Task<Playlist> SearchPlaylist(string url, int maxVideoCount)
|
||||
@@ -72,7 +73,8 @@ namespace VDownload.Sources
|
||||
return await mapping.Service.SearchPlaylist(url, maxVideoCount);
|
||||
}
|
||||
}
|
||||
throw new MediaSearchException("Source is not supported"); // TODO : Change to string resource
|
||||
|
||||
throw CreateExceptionSourceNotSupported();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -81,14 +83,17 @@ namespace VDownload.Sources
|
||||
|
||||
#region PRIVATE METHODS
|
||||
|
||||
private void BaseUrlCheck(string url)
|
||||
protected void BaseUrlCheck(string url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
{
|
||||
throw new MediaSearchException("Url cannot be empty"); // TODO : Change to string resource
|
||||
throw CreateExceptionEmptyUrl();
|
||||
}
|
||||
}
|
||||
|
||||
protected MediaSearchException CreateExceptionSourceNotSupported() => new MediaSearchException("SourceNotSupported");
|
||||
protected MediaSearchException CreateExceptionEmptyUrl() => new MediaSearchException("EmptyUrl");
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user