Skip to content

Commit

Permalink
Remove exception details from response
Browse files Browse the repository at this point in the history
  • Loading branch information
qligier committed Jan 26, 2024
1 parent b1a4140 commit 8c74f0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,14 @@ public void transform(org.hl7.fhir.r5.model.StructureMap map, HttpServletRequest
ServletOutputStream output = theServletResponse.getOutputStream();
try {
if (output != null) {
if (output != null && responseContentType.equals(Constants.CT_FHIR_JSON_NEW))
if (responseContentType.equals(Constants.CT_FHIR_JSON_NEW))
new org.hl7.fhir.r5.elementmodel.JsonParser(matchboxEngine.getContext()).compose(r, output, OutputStyle.PRETTY, null);
else
new org.hl7.fhir.r5.elementmodel.XmlParser(matchboxEngine.getContext()).compose(r, output, OutputStyle.PRETTY, null);
}
} catch(org.hl7.fhir.exceptions.FHIRException e) {
log.error("Transform exception", e);
output.write("Exception during Transform: ".getBytes());
output.write(e.getMessage().getBytes());
output.write("Exception during Transform".getBytes());
}
theServletResponse.getOutputStream().close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,14 @@ public void extract(org.hl7.fhir.r5.elementmodel.Element src, HttpServletRequest
ServletOutputStream output = theServletResponse.getOutputStream();
try {
if (output != null) {
if (output != null && responseContentType.equals(Constants.CT_FHIR_JSON_NEW))
if (responseContentType.equals(Constants.CT_FHIR_JSON_NEW))
new org.hl7.fhir.r5.elementmodel.JsonParser(matchboxEngine.getContext()).compose(r, output, OutputStyle.PRETTY, null);
else
new org.hl7.fhir.r5.elementmodel.XmlParser(matchboxEngine.getContext()).compose(r, output, OutputStyle.PRETTY, null);
}
} catch(org.hl7.fhir.exceptions.FHIRException e) {
log.error("Transform exception", e);
output.write("Exception during Transform: ".getBytes());
output.write(e.getMessage().getBytes());
output.write("Exception during Transform".getBytes());
}
theServletResponse.getOutputStream().close();
}
Expand Down

0 comments on commit 8c74f0e

Please sign in to comment.