forked from j62/ctbrec
Catch JSON parse exception
This commit is contained in:
parent
5fa939ae65
commit
a2e2dbda6d
|
@ -98,7 +98,8 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
return online;
|
return online;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isStreamAvailable() throws IOException {
|
private boolean isStreamAvailable() {
|
||||||
|
try {
|
||||||
String url = getStreamUrl();
|
String url = getStreamUrl();
|
||||||
Request req = new Request.Builder().url(url).build();
|
Request req = new Request.Builder().url(url).build();
|
||||||
try (Response resp = site.getHttpClient().execute(req)) {
|
try (Response resp = site.getHttpClient().execute(req)) {
|
||||||
|
@ -109,6 +110,10 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch(Exception e) {
|
||||||
|
LOG.warn("Couldn't check if stream is available: {}", e.getLocalizedMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private JSONObject getRoomData() throws IOException {
|
private JSONObject getRoomData() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue