namespace Cobra.Core class ExceptionReportWriter is abstract def writeReport(tw as TextWriter, exc as Exception?) .writeReport(tw, exc, CobraImp.detailedStackTrace) def writeReport(tw as TextWriter, exc as Exception?, frames as Stack) is abstract class TextExceptionReportWriter inherits ExceptionReportWriter def writeReport(tw as TextWriter, exc as Exception?, frames as Stack) is override # dump the most recent stack frames last since the text will output top-down and scroll in the shell tw.writeLine('Stack trace:') if not frames.count tw.writeLine('No stack frames.') else i = 0 for frame in frames frame.dumpText(tw, i) i += 1