Improve logging

This commit is contained in:
0xboobface 2019-04-20 14:26:31 +02:00
parent 80071a1eb4
commit f170ce2b07
2 changed files with 12 additions and 0 deletions

View File

@ -135,6 +135,8 @@ public class HlsDownload extends AbstractHlsDownload {
} catch(HttpException e) {
if(e.getResponseCode() == 404) {
LOG.debug("Playlist not found (404). Model {} probably went offline", model);
} else if(e.getResponseCode() == 403) {
LOG.debug("Playlist access forbidden (403). Model {} probably went private or offline", model);
} else {
throw e;
}

View File

@ -219,6 +219,16 @@ public class MergedHlsDownload extends AbstractHlsDownload {
} else {
break;
}
} catch(HttpException e) {
String modelName = model != null ? model.getName() : "n/a";
if(e.getResponseCode() == 404) {
LOG.debug("Playlist not found (404). Model {} probably went offline", modelName);
} else if(e.getResponseCode() == 403) {
LOG.debug("Playlist access forbidden (403). Model {} probably went private or offline", modelName);
} else {
LOG.info("Unexpected error while downloading {}", modelName, e);
}
running = false;
} catch(Exception e) {
if(model != null) {
LOG.info("Unexpected error while downloading {}", model.getName(), e);