Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
50a5b827
Commit
50a5b827
authored
Jan 31, 2017
by
Piotr Gawron
Browse files
error handling improved when source xml for drugs is invalid
parent
f2ea69f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
annotation/src/main/java/lcsb/mapviewer/annotation/services/ChEMBLParser.java
View file @
50a5b827
...
...
@@ -496,10 +496,18 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
Document
document
=
getXmlDocumentFromString
(
content
);
Node
response
=
getNode
(
"response"
,
document
);
if
(
response
==
null
)
{
throw
new
DrugSearchException
(
"Invalid source XML for drug: "
+
drugId
);
}
Node
moleculesNode
=
getNode
(
"molecules"
,
response
);
if
(
moleculesNode
==
null
)
{
throw
new
DrugSearchException
(
"Invalid source XML for drug: "
+
drugId
);
}
Node
moleculeNode
=
getNode
(
"molecule"
,
moleculesNode
);
if
(
moleculeNode
==
null
)
{
throw
new
DrugSearchException
(
"Invalid source XML for drug: "
+
drugId
);
}
return
parseDrug
(
moleculeNode
);
}
catch
(
IOException
e
)
{
throw
new
DrugSearchException
(
"Problem with accessing external database for id: "
+
drugId
,
e
);
}
catch
(
InvalidXmlSchemaException
e
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment