1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-04 08:25:03 -05:00

* make sure to include url to malformed xml in error log

This commit is contained in:
Reinhard Pointner 2014-04-10 13:48:01 +00:00
parent 91bf489c0c
commit 208f8f1ed8
2 changed files with 10 additions and 6 deletions

View File

@ -18,12 +18,12 @@ public abstract class AbstractCachedResource<R, T extends Serializable> {
public static final long ONE_WEEK = 7 * ONE_DAY; public static final long ONE_WEEK = 7 * ONE_DAY;
public static final long ONE_MONTH = 30 * ONE_DAY; public static final long ONE_MONTH = 30 * ONE_DAY;
private String resource; protected final String resource;
private Class<T> type; protected final Class<T> type;
private long expirationTime; protected final long expirationTime;
private int retryCountLimit; protected final int retryCountLimit;
private long retryWaitTime; protected final long retryWaitTime;
public AbstractCachedResource(String resource, Class<T> type, long expirationTime, int retryCountLimit, long retryWaitTime) { public AbstractCachedResource(String resource, Class<T> type, long expirationTime, int retryCountLimit, long retryWaitTime) {
this.resource = resource; this.resource = resource;

View File

@ -49,7 +49,11 @@ public class CachedXmlResource extends AbstractCachedResource<String, String> {
XMLReader reader = sax.newSAXParser().getXMLReader(); XMLReader reader = sax.newSAXParser().getXMLReader();
reader.setErrorHandler(new DefaultHandler()); // unwind on error reader.setErrorHandler(new DefaultHandler()); // unwind on error
reader.parse(new InputSource(new StringReader(data))); try {
reader.parse(new InputSource(new StringReader(data)));
} catch (SAXException e) {
throw new IOException("Malformed XML: " + getResourceLocation(resource), e);
}
return data; return data;
} }