added clarifying message to TelegramApiException if filePath parameter is empty

This commit is contained in:
timursergeevich 2021-11-06 21:32:57 +03:00
parent 46c5aa6b80
commit 17c336b1ec

View File

@ -56,7 +56,7 @@ public class TelegramFileDownloader {
public final java.io.File downloadFile(String filePath, java.io.File outputFile) throws TelegramApiException {
if (filePath == null || filePath.isEmpty()) {
throw new TelegramApiException("Parameter file can not be null");
throw new TelegramApiException("Parameter file can not be null or empty");
}
String url = File.getFileUrl(botTokenSupplier.get(), filePath);
return downloadToFile(url, outputFile);
@ -84,7 +84,7 @@ public class TelegramFileDownloader {
public final void downloadFileAsync(String filePath, DownloadFileCallback<String> callback) throws TelegramApiException {
if (filePath == null || filePath.isEmpty()) {
throw new TelegramApiException("Parameter filePath can not be null");
throw new TelegramApiException("Parameter filePath can not be null or empty");
}
if (callback == null) {
throw new TelegramApiException("Parameter callback can not be null");