If loading site specific fails, print out the model name
This commit is contained in:
parent
9958e04ef8
commit
8a8327a2a5
|
@ -5,6 +5,9 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.squareup.moshi.JsonAdapter;
|
||||
import com.squareup.moshi.JsonReader;
|
||||
import com.squareup.moshi.JsonReader.Token;
|
||||
|
@ -16,6 +19,8 @@ import ctbrec.sites.chaturbate.ChaturbateModel;
|
|||
|
||||
public class ModelJsonAdapter extends JsonAdapter<Model> {
|
||||
|
||||
private static final transient Logger LOG = LoggerFactory.getLogger(ModelJsonAdapter.class);
|
||||
|
||||
private List<Site> sites;
|
||||
|
||||
public ModelJsonAdapter() {
|
||||
|
@ -62,7 +67,12 @@ public class ModelJsonAdapter extends JsonAdapter<Model> {
|
|||
model.setSuspended(suspended);
|
||||
} else if(key.equals("siteSpecific")) {
|
||||
reader.beginObject();
|
||||
model.readSiteSpecificData(reader);
|
||||
try {
|
||||
model.readSiteSpecificData(reader);
|
||||
} catch(Exception e) {
|
||||
LOG.error("Couldn't read site specific data for model {}", model.getName());
|
||||
throw e;
|
||||
}
|
||||
reader.endObject();
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue