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) { } catch(HttpException e) {
if(e.getResponseCode() == 404) { if(e.getResponseCode() == 404) {
LOG.debug("Playlist not found (404). Model {} probably went offline", model); 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 { } else {
throw e; throw e;
} }

View File

@ -219,6 +219,16 @@ public class MergedHlsDownload extends AbstractHlsDownload {
} else { } else {
break; 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) { } catch(Exception e) {
if(model != null) { if(model != null) {
LOG.info("Unexpected error while downloading {}", model.getName(), e); LOG.info("Unexpected error while downloading {}", model.getName(), e);