From: Mateusz Warowny Date: Fri, 2 Jun 2023 13:07:50 +0000 (+0200) Subject: JAL-3954 Report error log when job fails X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cf430e4a0397a2fd50a70e39a141b911b35e9a0b;p=jalview.git JAL-3954 Report error log when job fails --- diff --git a/src/jalview/ws2/client/ebi/PhmmerWSClient.java b/src/jalview/ws2/client/ebi/PhmmerWSClient.java index 9c5f14f..380e8e6 100644 --- a/src/jalview/ws2/client/ebi/PhmmerWSClient.java +++ b/src/jalview/ws2/client/ebi/PhmmerWSClient.java @@ -1,6 +1,7 @@ package jalview.ws2.client.ebi; import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -231,7 +232,14 @@ public class PhmmerWSClient implements AlignmentWebServiceClientI @Override public String getErrorLog(WebServiceJobHandle job) throws IOException { - return ""; + if (getStatus(job) != JobStatus.FAILED) + return ""; + try(InputStream stream = client.getResultStream(job.getJobId(), "error")) + { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + stream.transferTo(out); + return out.toString(); + } } @Override