Log when cameras do not support BASIC support. (#15168)
Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
parent
41e4cc4545
commit
a6b2b92513
|
@ -352,7 +352,13 @@ public class TelegramActions implements ThingActions {
|
||||||
byte[] fileContent = contentResponse.getContent();
|
byte[] fileContent = contentResponse.getContent();
|
||||||
sendPhoto = new SendPhoto(chatId, fileContent);
|
sendPhoto = new SendPhoto(chatId, fileContent);
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Download from {} failed with status: {}", photoURL, contentResponse.getStatus());
|
if (contentResponse.getStatus() == 401
|
||||||
|
&& contentResponse.getHeaders().get(HttpHeader.WWW_AUTHENTICATE).contains("igest")) {
|
||||||
|
logger.warn("Download from {} failed due to no BASIC http auth support.", photoURL);
|
||||||
|
} else {
|
||||||
|
logger.warn("Download from {} failed with status: {}", photoURL,
|
||||||
|
contentResponse.getStatus());
|
||||||
|
}
|
||||||
sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
|
sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -555,7 +561,13 @@ public class TelegramActions implements ThingActions {
|
||||||
byte[] fileContent = contentResponse.getContent();
|
byte[] fileContent = contentResponse.getContent();
|
||||||
sendVideo = new SendVideo(chatId, fileContent);
|
sendVideo = new SendVideo(chatId, fileContent);
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Download from {} failed with status: {}", videoURL, contentResponse.getStatus());
|
if (contentResponse.getStatus() == 401
|
||||||
|
&& contentResponse.getHeaders().get(HttpHeader.WWW_AUTHENTICATE).contains("igest")) {
|
||||||
|
logger.warn("Download from {} failed due to no BASIC http auth support.", videoURL);
|
||||||
|
} else {
|
||||||
|
logger.warn("Download from {} failed with status: {}", videoURL,
|
||||||
|
contentResponse.getStatus());
|
||||||
|
}
|
||||||
sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
|
sendTelegram(chatId, caption + ":Download failed with status " + contentResponse.getStatus());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue