Skip to content

Commit

Permalink
add error messages to GUI Log output #495
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaBurek committed Oct 16, 2023
1 parent be8e937 commit a62885e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions java/edu/ucar/metviewer/MVUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -1872,12 +1872,18 @@ public static MvResponse runRscript(
}
if (strProcStd.length() > 0) {
mvResponse.setInfoMessage(
"==== Start " + type + " output ====\n" + strProcStd + "==== End " + type + " output ====");
"\n==== Start " + type + " output ====\n" + strProcStd + "==== End " + type + " output ====\n");
}

// add errors if they exist - only the last line
if (strProcErr.length() > 0) {
String[] errorLines = strProcErr.toString().split("\\r?\\n|\\r");
mvResponse.setInfoMessage(
mvResponse.getInfoMessage() + "\n==== Start " + type + " ERROR ====\n" + errorLines[errorLines.length-1] + "\n==== End " + type + " error ====\n"

);

mvResponse.setErrorMessage(
"==== Start " + type + " error ====\n" + strProcErr + "==== End " + type + " error ====");
"==== Start " + type + " error ====\n" + strProcErr + "==== End " + type + " ERROR ====");
}
mvResponse.setSuccess(0 == intExitStatus);
return mvResponse;
Expand Down
4 changes: 2 additions & 2 deletions java/edu/ucar/metviewer/MvResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
public class MvResponse {

private boolean success = false;
private String infoMessage;
private String errorMessage;
private String infoMessage = "";
private String errorMessage = "";

public boolean isSuccess() {
return success;
Expand Down

0 comments on commit a62885e

Please sign in to comment.