Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
} catch (SBOLValidationException | IOException | SBOLConversionException | ParserConfigurationException
| TransformerException | SAXException | TransformerFactoryConfigurationError | URISyntaxException | SynBioHubException | javax.xml.stream.XMLStreamException e) {
ServletOutputStream outputStream = response.getOutputStream();
String message = e.getMessage() != null ? e.getMessage() : "Export failed";
String message = errorMessage(e);
InputStream inputStream = new ByteArrayInputStream(message.getBytes());
IOUtils.copy(inputStream, outputStream);

response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
e.printStackTrace();
} catch (RuntimeException e) {
// Catch unchecked exceptions from SBML export
String message = e.getMessage() != null ? e.getMessage() : "Export failed";
String message = errorMessage(e);
ServletOutputStream outputStream = response.getOutputStream();
InputStream inputStream = new ByteArrayInputStream(message.getBytes());
IOUtils.copy(inputStream, outputStream);
Expand All @@ -102,4 +102,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
}
}

private static String errorMessage(Throwable e) {
String message = e.getMessage();
return message != null ? e.getClass().getSimpleName() + ": " + message : e.getClass().getSimpleName();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private mxCell renderCircuitContainer(mxGraph graph, mxCell viewCell, ComponentD
// Check if a circular backbone is present, if so add a duplicate for the right end in SBOLCanvas
for (Component glyph : newList) {
ComponentDefinition cd = glyph.getDefinition();
if (cd != null && cd.getRoles().iterator().next().equals(SBOLData.roles.getValue("Cir (Circular Backbone)"))) {
if (cd != null && cd.getRoles().contains(SBOLData.roles.getValue("Cir (Circular Backbone)"))) {
duplicateToAdd = glyph;
}
}
Expand Down
Loading