I am throwing a custom exception as below to UI
StringBuilder errorMessage = new StringBuilder("Error One Message");
String newlinetest = System.getProperty("line.separator");
// String sep = System.line.separator;
String secondErrorMessage = "Error Two message";
throw new ErrorWhileCreatingMessageException(errorMessage+"\r\n"+secondErrorMessage);
I need to add new line between two error messages before throwing. I tried \n, \r\n and line. separator it didn't work. Any help on this is much appreciated
I am using Angular JS in the UI. I am displaying as below
<div ng-show="error != null">
<div class="alert alert-danger" role="alert" ng-bind="error"></div>
</div>
UI?\nshould create a new line for display (but not necessarily for a text file) -- more importantly -- how are you displaying the exception String? Best to create and post a valid minimal reproducible example / sscce.UI???