bqw5189 / closure-templates

Automatically exported from code.google.com/p/closure-templates
Apache License 2.0
0 stars 0 forks source link

Exceptions thrown in functions have their stack traces discarded #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This makes debugging applications which use custom functions difficult.

If an exception is thrown by

TofuEvalVisitor.java:75 return fn.computeForTofu(args);

The stack trace is not recorded, because the catch clause does:

      throw new RenderException(
          "Error while computing function \"" + fnNode.toSourceString() + "\": " + e.getMessage());

Fixing this alone would not be enough, as later on the RenerException is 
converted to a SoyException thus:

/**
   * Creates an instance by copying a RenderException.
   * @param re The RenderException to copy.
   */
  public SoyTofuException(RenderException re) {
    super(re.getRawMessage());
    this.templateName = re.getTemplateName();
  }

Original issue reported on code.google.com by tgdav...@gmail.com on 4 Mar 2013 at 1:17

GoogleCodeExporter commented 9 years ago
Closure Templates has migrated to GitHub: 
https://github.com/google/closure-templates. Please reopen this there if it's 
still an issue.

Original comment by brendan....@gmail.com on 27 Feb 2015 at 12:09