On Thu, Jul 12, 2012 at 10:14 AM, Charles Oliver Nutter
<head...@headius.com> wrote:
>
> I dare say JRuby has the nicest stack traces of any language on the JVM.

Well, as far as showing pride in the way you tackle error reporting,
I'm actually very proud of the level of detail we put into exception
reporting for FreeMarker.

Just Googling "The problematic instruction ftl" gives some nice
examples on the web, here's one from
<https://community.jivesoftware.com/thread/58497>.

If you look at it, you'll notice it's carefully formatted for human
readability - the whole logged string is how FreeMarker formats the
exception message.

It starts with the statemet of the problem and hints at a possible
cause. This is followed by a language specific stack trace (which
shows the offending instruction, and then any
includes/imports/function calls it might be in, here it's only a
single include, so it's quite shallow). Since this is a templating
language, it prints not only the line number, but the column number of
the instructions.

Finally the actual Java stack trace, delineated and labeled "for
programmers" (to distinguish the audience - it's not supposed to be
interesting for template authors).

Sometimes the contrast between the sizes of the high-level language
stack trace and the lower level (Java) trace is quite staggering, i.e.
<http://forum.magnolia-cms.com/forum/thread.html?threadId=9081f420-ba5f-4df5-9297-d4acb399b8f9>,
which just goes to show this is something that language implementers
really need to pay attention to.

Attila.
_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to