From cf430e4a0397a2fd50a70e39a141b911b35e9a0b Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 2 Jun 2023 15:07:50 +0200 Subject: [PATCH] JAL-3954 Report error log when job fails --- src/jalview/ws2/client/ebi/PhmmerWSClient.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 1.7.10.2