Commit 85dd9930 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

error handling/reporting improved

parent d2277318
......@@ -811,6 +811,14 @@ public class BigFileCache {
*/
public boolean isCached(String sourceUrl) {
BigFileEntry entry = bigFileEntryDao.getByUrl(sourceUrl);
if (entry != null) {
File f = new File(Configuration.getWebAppDir() + entry.getLocalPath());
if (!f.exists()) {
logger.warn("File is supposed to be cached but it's not there... " + sourceUrl);
bigFileEntryDao.delete(entry);
entry = null;
}
}
return entry != null;
}
......
......@@ -572,7 +572,7 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi
int id = page.indexOf("<th>DrugBank ID</th>");
if (id < 0) {
throw new InvalidArgumentException("Problematic web page");
throw new DrugSearchException("Problematic web page for target: " + drugbankTarget + "(" + hgncTarget + ")");
}
int i = page.indexOf("/polypeptides/");
......
......@@ -320,7 +320,7 @@ public class ChemicalService implements IChemicalService {
chemicalViewFactory.create(chemical);
}
} catch (ChemicalSearchException e) {
logger.error("Problem with accessing info about chemical for target", e);
logger.error("Problem with accessing info about chemical for target: " + md, e);
}
counter += 1;
progress = counter / (double) targetMiriams.size();
......
......@@ -399,7 +399,7 @@ public class DrugService implements IDrugService {
drugViewFactory.create(chemical);
}
} catch (DrugSearchException e) {
logger.error("Problem with accessing info about drugbank for target", e);
logger.error("Problem with accessing info about drugbank for target: " + md, e);
}
try {
List<Drug> chemicalList = chEMBLParser.getDrugListByTarget(md);
......@@ -407,7 +407,7 @@ public class DrugService implements IDrugService {
drugViewFactory.create(chemical);
}
} catch (DrugSearchException e) {
logger.error("Problem with accessing info about chembl for target", e);
logger.error("Problem with accessing info about chembl for target: " + md, e);
}
counter += 1;
progress = counter / (double) targetMiriams.size();
......
......@@ -240,7 +240,7 @@ public class MiRNAService implements IMiRNAService {
miRNAViewFactory.create(chemical);
}
} catch (MiRNASearchException e) {
logger.error("Problem with accessing info about mirna for target", e);
logger.error("Problem with accessing info about mirna for target: " + md, e);
}
progress = counter / (double) targetMiriams.size();
iProgressUpdater.setProgress(progress * IProgressUpdater.MAX_PROGRESS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment