diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotator.java index cc2af5f03a65e73a088b803350be2885206ba860..5a673aa4b636c7f0122d662bddb9f471ec6b534b 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotator.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ChebiAnnotator.java @@ -27,7 +27,6 @@ import lcsb.mapviewer.model.map.MiriamType; import lcsb.mapviewer.model.map.species.Chemical; import lcsb.mapviewer.modelutils.map.ElementUtils; import uk.ac.ebi.chebi.webapps.chebiWS.client.ChebiWebServiceClient; -import uk.ac.ebi.chebi.webapps.chebiWS.model.ChebiWebServiceFault_Exception; import uk.ac.ebi.chebi.webapps.chebiWS.model.DataItem; import uk.ac.ebi.chebi.webapps.chebiWS.model.Entity; import uk.ac.ebi.chebi.webapps.chebiWS.model.LiteEntity; @@ -205,7 +204,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService } } } - } catch (ChebiWebServiceFault_Exception e) { + } catch (Exception e) { throw new ChebiSearchException("Problem with chebi connection", e); } return null; @@ -290,7 +289,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService String value = miriamListToStringList(result); setCacheValue(query, value); - } catch (ChebiWebServiceFault_Exception e) { + } catch (Exception e) { throw new ChebiSearchException("Problem with chebi", e); } return result; @@ -300,7 +299,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService * Serialize list of chebi identifiers. * * @param list - * list of chebi identfiers + * list of chebi identifiers * @return string with identifiers */ private String miriamListToStringList(List<MiriamData> list) { @@ -357,7 +356,6 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService } try { ChebiWebServiceClient client = getClient(); - LiteEntityList entities = client.getLiteEntity(id, SearchCategory.CHEBI_ID, MAX_SEARCH_RESULTS_FROM_CHEBI_API, StarsCategory.ALL); List<LiteEntity> resultList = entities.getListElement(); @@ -374,7 +372,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService setCacheValue("id: " + id, chebiSerializer.objectToString(result)); } return result; - } catch (ChebiWebServiceFault_Exception e) { + } catch (Exception e) { throw new ChebiSearchException("Problem with chebi", e); } } @@ -387,7 +385,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService * identifier): "CHEBI:XXXXX" or "XXXXX" * @return common name of chemical * @throws ChebiSearchException - * thrown when there is a problemw ith accessing information from + * thrown when there is a problem with accessing information from * external chebi database */ protected String getChebiNameForChebiId(MiriamData id) throws ChebiSearchException {