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 { ...@@ -811,6 +811,14 @@ public class BigFileCache {
*/ */
public boolean isCached(String sourceUrl) { public boolean isCached(String sourceUrl) {
BigFileEntry entry = bigFileEntryDao.getByUrl(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; return entry != null;
} }
......
...@@ -572,7 +572,7 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi ...@@ -572,7 +572,7 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi
int id = page.indexOf("<th>DrugBank ID</th>"); int id = page.indexOf("<th>DrugBank ID</th>");
if (id < 0) { if (id < 0) {
throw new InvalidArgumentException("Problematic web page"); throw new DrugSearchException("Problematic web page for target: " + drugbankTarget + "(" + hgncTarget + ")");
} }
int i = page.indexOf("/polypeptides/"); int i = page.indexOf("/polypeptides/");
......
...@@ -320,7 +320,7 @@ public class ChemicalService implements IChemicalService { ...@@ -320,7 +320,7 @@ public class ChemicalService implements IChemicalService {
chemicalViewFactory.create(chemical); chemicalViewFactory.create(chemical);
} }
} catch (ChemicalSearchException e) { } 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; counter += 1;
progress = counter / (double) targetMiriams.size(); progress = counter / (double) targetMiriams.size();
......
...@@ -399,7 +399,7 @@ public class DrugService implements IDrugService { ...@@ -399,7 +399,7 @@ public class DrugService implements IDrugService {
drugViewFactory.create(chemical); drugViewFactory.create(chemical);
} }
} catch (DrugSearchException e) { } 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 { try {
List<Drug> chemicalList = chEMBLParser.getDrugListByTarget(md); List<Drug> chemicalList = chEMBLParser.getDrugListByTarget(md);
...@@ -407,7 +407,7 @@ public class DrugService implements IDrugService { ...@@ -407,7 +407,7 @@ public class DrugService implements IDrugService {
drugViewFactory.create(chemical); drugViewFactory.create(chemical);
} }
} catch (DrugSearchException e) { } 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; counter += 1;
progress = counter / (double) targetMiriams.size(); progress = counter / (double) targetMiriams.size();
......
...@@ -240,7 +240,7 @@ public class MiRNAService implements IMiRNAService { ...@@ -240,7 +240,7 @@ public class MiRNAService implements IMiRNAService {
miRNAViewFactory.create(chemical); miRNAViewFactory.create(chemical);
} }
} catch (MiRNASearchException e) { } 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(); progress = counter / (double) targetMiriams.size();
iProgressUpdater.setProgress(progress * IProgressUpdater.MAX_PROGRESS); 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