Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 895 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 895 Bytes

html-exception-formatter

a Java library to format exceptions to pretty html

Usage

Very basic usage

  String html = new HtmlExceptionsFormatter().toString(exception);

Setting Options

  HtmlExceptionFormatOptions options = new HtmlExceptionFormatOptions();
  options.setPrintDetails(true);
  String html = new HtmlExceptionsFormatter().toString(exception);

Non Exception messages

  HtmlExceptionFormatOptions options = new HtmlExceptionFormatOptions();
  options.setPrintDetails(true);
  String html = new HtmlExceptionsFormatter().toString("404 Route not found", "The selected \"/noPath\" route wasn't found.");

Writing into Appendable

  HtmlExceptionFormatOptions options = new HtmlExceptionFormatOptions();
  options.setPrintDetails(true);
  new HtmlExceptionsFormatter().formatMessage(System.err, exception);