Skip to content

Commit

Permalink
Add PrintWriter to errorAndClose method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Feb 3, 2025
1 parent df944b0 commit a3f9074
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/ecocean/servlet/MergeIndividual.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
"<strong>Error:</strong> Missing two valid individualIDs for MergeIndividual. ";
if (id1 == null) msg += "<br>Bad id1: " + id1;
if (id2 == null) msg += "<br>Bad id2: " + id2;
errorAndClose(msg, response);
errorAndClose(msg, response,out);
return;
}
String oldName1;
Expand All @@ -64,7 +64,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
"<strong>Error:</strong> Could not find both individuals in our database. ";
if (mark1 == null) msg += "<br>could not find individual " + mark1;
if (mark2 == null) msg += "<br>could not find individual " + mark2;
errorAndClose(msg, response);
errorAndClose(msg, response,out);
myShepherd.rollbackDBTransaction();
myShepherd.closeDBTransaction();
return;
Expand Down Expand Up @@ -165,7 +165,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
}
} catch (Exception le) {
le.printStackTrace();
errorAndClose("An exception occurred. Please contact the admins.", response);
errorAndClose("An exception occurred. Please contact the admins.", response, out);
myShepherd.rollbackDBTransaction();
myShepherd.closeDBTransaction();
return;
Expand Down Expand Up @@ -194,11 +194,11 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
} else {
errorAndClose(
"<strong>Failure!</strong> This encounter is currently being modified by another user, or an exception occurred. Please wait a few seconds before trying to modify this encounter again.",
response);
response,out);
}
}

private void errorAndClose(String msg, HttpServletResponse response) {
private void errorAndClose(String msg, HttpServletResponse response, PrintWriter out) {
// out.println(ServletUtilities.getHeader(request));
out.println(msg);
// out.println("<p><a href=\"http://"+CommonConfiguration.getURLLocation(request)+"/encounters/encounter.jsp?number="+encNum+"\">Return to
Expand Down

0 comments on commit a3f9074

Please sign in to comment.