Closed Bug 506302 Opened 15 years ago Closed 15 years ago

Shorten stack traces

Categories

(Cloud Services :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Mardak, Assigned: Mardak)

Details

When we print out stack traces, do we want to only show the last some frames as well as not bother printing out the whole path of the file?

Right now every weave-related-code frame includes the whole profile path then extension guid then actual useful weave modules files or chrome files. Arguably we only really need the file name (I don't think we have conflicts..)

How many frames should we show? Until it leaves weave frames?
We do have some code to strip out unwanted portions of the path:

http://hg.mozilla.org/labs/weave/file/tip/source/modules/util.js#l346

Perhaps it's not being called?
Summary: Shorten stack trackes → Shorten stack traces
We do use that code, but that's only useful for nsIExceptions I believe.. a js exception.stack gives a newline separated string of stuff
http://hg.mozilla.org/labs/weave/rev/34b922993523
Trim the full path from JS stacks and just show the file and convert nsIException traces to look like js stacks: func()@file:line. Only difference is js stacks show arguments while nsIException always shows just (). Fix up some places where we print the exception instead of the fixed up string. 

So instead of..

Failed to import record: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIHtt
pChannel.requestSucceeded]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: file:///Users/Ed/weave/dist/stage/modules/resource.js :: Res__request :: line 275"  data: no]

It's..

Failed to import record: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIHttpChannel.requestSucceeded] Stack trace: Res__request()@resource.js:275 ...
Assignee: nobody → edilee
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.5
You need to log in before you can comment on or make changes to this bug.