History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5182
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: P T Withington
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

We could give better backtraces for unhandled errors in DHTML

Created: 02/Dec/07 04:19 PM   Updated: 04/Dec/07 02:03 PM
Component/s: Debugger
Affects Version/s: RingDing (4.1)
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 7,445
Runtime: N/A
Fix in hand: False


 Description  « Hide
In DHTML we have a 'last ditch' error handler that handles any errors that bubble up to the window object, but that handler simply passes the error string to $reportSourceWarning, so the accompanying backtrace is meaningless. This is not a problem for wizards who can use Opera or Firebug to decrypt a backtrace from the compressed DHTML, but we could do better for the naive user by capturing our backtrace stack when an error is signaled and then using that captured stack for the default handler reports.

Test case:

<canvas>
  <script>
    function Foo () { null.bar(); };
    (function test () {
      Debug.info("Current line number");
      new Foo();
    })();
 </script>
</canvas>

In Firefox this will currently report:

ERROR @http://dueling-banjos.local:8080/ringding-clean/test/lpp-xxxx.lzx?lzt=object&lzt=object&debug=true&lzr=dhtml&lzbacktrace=true#50: null has no properties

but it really should report:

ERROR @lpp-xxxx.lzx#3: null has no properties

[I'm not sure I can make this work in any browser _other_ than Firefox -- they seem to abort our runtime as soon as an unhandled error is signalled.]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 04/Dec/07 02:03 PM
r7445 | ptw | 2007-12-04 17:00:52 -0500 (Tue, 04 Dec 2007) | 28 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
   M /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/LzMessage.lzs
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java

Change 20071202-ptw-w by ptw@dueling-banjos.local on 2007-12-02 20:37:06 EST
    in /Users/ptw/OpenLaszlo/ringding-2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Debugger improvements to help me with diamond DHTML

Bugs Fixed:
LPP-5182 'We could give better backtraces for unhandled errors in DHTML'
LPP-5181 'new calls do not have correct line number in backtrace'

Technical Reviewer: dda@ddanderson.com (Message-Id: <FA6270BB-CDAD-4533-B76B-25F0D9981C6C@ddanderson.com>)
QA Reviewer: ewinard@laszlosystems.com (pending)

Details:
    LzMessage: Look for saved backtrace

    LzRuntime: Pass uncaught error backtrace to LzMessage

    JavascriptGenerator, CodeGenerator: Break out call-site
    annotation, use in function calls and new calls

    JavascriptGenerator: Put a catch block around all functions to
    record a backtrace if an exception is thrown and not caught.

Tests:
    smokecheck, test case from bugs