Commit ac7c1d8a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

check if type is proper reference genome type

parent d9130144
......@@ -168,7 +168,12 @@ public class ReferenceGenomeRestImpl extends BaseRestImpl {
public List<Map<String, Object>> getReferenceGenomeVersions(String organismId, String type)
throws QueryException {
ReferenceGenomeType genomeType = ReferenceGenomeType.valueOf(type);
ReferenceGenomeType genomeType = null;
try {
genomeType = ReferenceGenomeType.valueOf(type);
} catch (IllegalArgumentException e) {
throw new QueryException("Invalid type: " + type);
}
MiriamData organism;
if (organismId != null && !organismId.isEmpty()) {
organism = new MiriamData(MiriamType.TAXONOMY, organismId);
......
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