Merge pull request #994 from timursergeevichname/master

added clarifying message to TelegramApiException if filePath parameter is empty
This commit is contained in:
Ruben Bermudez 2021-11-14 21:26:15 +00:00 committed by GitHub
commit 5e9e91216a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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");