Class RecursivelyDescribeExceptionStack

Object
RecursivelyDescribeExceptionStack

public class RecursivelyDescribeExceptionStack extends Object
Generates a nice string representation of an Exception and its causes according to certain rules.
Author:
Owen Feehan
  • Method Details

    • apply

      public static void apply(Throwable excDescribe, Writer writer, String prefix, int wordWrapLimit, boolean showExceptionType) throws IOException
      Incrementally adds a line to a string builder with the message of each exception moving onto the next nested exception until there are no more
      Parameters:
      excDescribe - exception to describe
      writer - where the friendly-messaged is outputted
      prefix - incrementally prepended to each message (first message is skipped)
      wordWrapLimit - max-number of characters of a single-line of the screen (considering only prefix + line), if it's -1 it is disabled
      showExceptionType - adds a rightmost column showing the exception class type
      Throws:
      IOException - if an I/O error occurs with the writer