Skip to content
Snippets Groups Projects
Commit 0d9a06bf authored by Piotr Gawron's avatar Piotr Gawron
Browse files

exception passing improved

parent 7d11e44b
No related branches found
No related tags found
1 merge request!366broken chebi annotator doesn't stop data uploading
Pipeline #
...@@ -27,7 +27,6 @@ import lcsb.mapviewer.model.map.MiriamType; ...@@ -27,7 +27,6 @@ import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.species.Chemical; import lcsb.mapviewer.model.map.species.Chemical;
import lcsb.mapviewer.modelutils.map.ElementUtils; import lcsb.mapviewer.modelutils.map.ElementUtils;
import uk.ac.ebi.chebi.webapps.chebiWS.client.ChebiWebServiceClient; 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.DataItem;
import uk.ac.ebi.chebi.webapps.chebiWS.model.Entity; import uk.ac.ebi.chebi.webapps.chebiWS.model.Entity;
import uk.ac.ebi.chebi.webapps.chebiWS.model.LiteEntity; import uk.ac.ebi.chebi.webapps.chebiWS.model.LiteEntity;
...@@ -205,7 +204,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService ...@@ -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); throw new ChebiSearchException("Problem with chebi connection", e);
} }
return null; return null;
...@@ -290,7 +289,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService ...@@ -290,7 +289,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
String value = miriamListToStringList(result); String value = miriamListToStringList(result);
setCacheValue(query, value); setCacheValue(query, value);
} catch (ChebiWebServiceFault_Exception e) { } catch (Exception e) {
throw new ChebiSearchException("Problem with chebi", e); throw new ChebiSearchException("Problem with chebi", e);
} }
return result; return result;
...@@ -300,7 +299,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService ...@@ -300,7 +299,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
* Serialize list of chebi identifiers. * Serialize list of chebi identifiers.
* *
* @param list * @param list
* list of chebi identfiers * list of chebi identifiers
* @return string with identifiers * @return string with identifiers
*/ */
private String miriamListToStringList(List<MiriamData> list) { private String miriamListToStringList(List<MiriamData> list) {
...@@ -357,7 +356,6 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService ...@@ -357,7 +356,6 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
} }
try { try {
ChebiWebServiceClient client = getClient(); ChebiWebServiceClient client = getClient();
LiteEntityList entities = client.getLiteEntity(id, SearchCategory.CHEBI_ID, MAX_SEARCH_RESULTS_FROM_CHEBI_API, LiteEntityList entities = client.getLiteEntity(id, SearchCategory.CHEBI_ID, MAX_SEARCH_RESULTS_FROM_CHEBI_API,
StarsCategory.ALL); StarsCategory.ALL);
List<LiteEntity> resultList = entities.getListElement(); List<LiteEntity> resultList = entities.getListElement();
...@@ -374,7 +372,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService ...@@ -374,7 +372,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
setCacheValue("id: " + id, chebiSerializer.objectToString(result)); setCacheValue("id: " + id, chebiSerializer.objectToString(result));
} }
return result; return result;
} catch (ChebiWebServiceFault_Exception e) { } catch (Exception e) {
throw new ChebiSearchException("Problem with chebi", e); throw new ChebiSearchException("Problem with chebi", e);
} }
} }
...@@ -387,7 +385,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService ...@@ -387,7 +385,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
* identifier): "CHEBI:XXXXX" or "XXXXX" * identifier): "CHEBI:XXXXX" or "XXXXX"
* @return common name of chemical * @return common name of chemical
* @throws ChebiSearchException * @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 * external chebi database
*/ */
protected String getChebiNameForChebiId(MiriamData id) throws ChebiSearchException { protected String getChebiNameForChebiId(MiriamData id) throws ChebiSearchException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment