Skip to content

Commit

Permalink
adding error view page
Browse files Browse the repository at this point in the history
  • Loading branch information
sherrif10 committed Feb 10, 2021
1 parent 6c7e64a commit 64ffe44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@
import org.openmrs.ui.framework.annotation.SpringBean;
import org.openmrs.ui.framework.page.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.request.WebRequest;

public class ViewEncounterWithHtmlFormPageController {

Expand Down Expand Up @@ -72,10 +68,8 @@ public void get(@RequestParam("encounter") Encounter encounter,

if (htmlForm == null) {
message = messageSourceService.getMessage("encounter.form is not an HTML Form" +encounter.getForm());
log.warn("Active drugs are cannot be editted");
model.addAttribute("htmlForm", htmlForm);


log.warn("Active drugs are cannot be editted");

}
model.addAttribute("htmlForm", htmlForm);
}
Expand All @@ -90,9 +84,9 @@ private String fixCase(String word) {

@ExceptionHandler(value= NullPointerException.class)
public String HandleNullPointerException(Exception e) {
log.warn("encounter.form is not an HTML Form");
return "NullPointerException";
}
log.warn("encounter.form is not an HTML Form");
return "NullPointerException";
}


}
7 changes: 7 additions & 0 deletions omod/src/main/webapp/pages/htmlform/NullPointerException.gsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<html>
<body>
<p>Application has encountered an error. Please contact support on ...</p>
<% out << " ooppsss!!!! Active drugs cannot be edittted!" %>
<!--
Failed URL: ${url}
Exception: ${exception.message}
<c:forEach items="${exception.stackTrace}" var="ste"> ${ste}
</c:forEach>
-->
</body>
</html>

0 comments on commit 64ffe44

Please sign in to comment.