|
642 | 642 | (defn- render-exception |
643 | 643 | [exception-stack options] |
644 | 644 | (let [{show-properties? :properties |
645 | | - :or {show-properties? true}} options |
| 645 | + :keys [traditional] |
| 646 | + :or {show-properties? true |
| 647 | + traditional *traditional*}} options |
646 | 648 | exception-font (:exception *fonts*) |
647 | 649 | message-font (:message *fonts*) |
648 | 650 | property-font (:property *fonts*) |
649 | | - modern? (not *traditional*) |
| 651 | + modern? (not traditional) |
650 | 652 | max-class-name-width (max-from exception-stack #(-> % :class-name length)) |
651 | 653 | message-indent (+ 2 max-class-name-width) |
652 | 654 | exception-f (fn [{:keys [class-name message properties]}] |
|
678 | 680 | "\n") |
679 | 681 | root-stack-trace (-> exception-stack last :stack-trace)] |
680 | 682 | (list |
681 | | - (when *traditional* |
| 683 | + (when traditional |
682 | 684 | exceptions) |
683 | 685 |
|
684 | 686 | (build-stack-trace-output root-stack-trace modern?) |
|
707 | 709 | :filter | The stack frame filter, which defaults to [[*default-stack-frame-filter*]] |
708 | 710 | :properties | If true (the default) then properties of exceptions will be output |
709 | 711 | :frame-limit | If non-nil, the number of stack frames to keep when outputting the stack trace of the deepest exception |
| 712 | + :traditional | If true, the use the traditional Java ordering of stack frames. |
| 713 | +
|
| 714 | + Output may be traditional or modern, as controlled by the :traditonal option |
| 715 | + (which defaults to the value of [[*traditional*]]). |
710 | 716 |
|
711 | | - Output may be traditional or modern, as controlled by [[*traditional*]]. |
712 | 717 | Traditional is the typical output order for Java: the stack of exceptions comes first (outermost to |
713 | 718 | innermost) followed by the stack trace of the innermost exception, with the frames |
714 | 719 | in order from deepest to most shallow. |
715 | 720 |
|
716 | | - Modern output is more readable; the stack trace comes first and is reversed: shallowest frame to most deep. |
| 721 | + Modern output is the default: the stack trace comes first and is reversed: shallowest frame to most deep. |
717 | 722 | Then the exception stack is output, from the root exception to the outermost exception. |
718 | 723 | The modern output order is more readable, as it puts the most useful information together at the bottom, so that |
719 | | - it is not necessary to scroll back to see, for example, where the exception occurred. |
720 | | -
|
721 | | - The default is modern. |
| 724 | + it is not necessary to scroll back to see, for example, where the exception occurred, and more sensible, |
| 725 | + since it reflects a chronological order. |
722 | 726 |
|
723 | 727 | The stack frame filter is passed the map detailing each stack frame |
724 | 728 | in the stack trace, and must return one of the following values: |
|
0 commit comments