Improve exception handling

Don't log a stacktrace, if the server returns a 404 for the playlist
This commit is contained in:
0xboobface 2018-11-15 12:50:18 +01:00
parent 81cfdf8439
commit 5e063eb91c
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import com.iheartradio.m3u8.PlaylistException;
import ctbrec.Config;
import ctbrec.Model;
import ctbrec.io.HttpClient;
import ctbrec.io.HttpException;
import okhttp3.Request;
import okhttp3.Response;
@ -114,6 +115,12 @@ public class HlsDownload extends AbstractHlsDownload {
} catch(EOFException e) {
// end of playlist reached
LOG.debug("Reached end of playlist for model {}", model);
} catch(HttpException e) {
if(e.getResponseCode() == 404) {
LOG.debug("Playlist not found (404). Model {} probably went offline", model);
} else {
throw e;
}
} catch(Exception e) {
throw new IOException("Couldn't download segment", e);
} finally {