URL url = getUrl(ids);
BufferedReader reader = getHttpResponse(url, ids);
+ if (reader == null)
+ {
+ // request failed
+ return null;
+ }
FileParse fp = new FileParse(reader, url.toString(), "HTTP_POST");
return fp;
}
* note: a GET request for an invalid id returns an error code e.g. 415
* but POST request returns 200 and an empty Fasta response
*/
- throw new IOException(
- "Response code was not 200. Detected response was "
- + responseCode);
+ System.err.println("Response code " + responseCode + " for " + url);
+ return null;
}
// get content
InputStream response = connection.getInputStream();
throw new JalviewException("ENSEMBL Rest API not available.");
}
FileParse fp = getSequenceReader(ids);
+ if (fp == null)
+ {
+ return alignment;
+ }
+
FastaFile fr = new FastaFile(fp);
if (fr.hasWarningMessage())
{