Closed Bug 781760 Opened 12 years ago Closed 10 years ago

Stack trace missing in terminal

Categories

(Add-on SDK Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mirza+mozillia, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713224758

Steps to reproduce:

Executed 'cfx run' with these files.

/* main.js file */

var pageMod = require("page-mod");
var self = require('self');

pageMod.PageMod({
	include: '*.com',
	contentScriptFile: [
		self.data.url('index.js'),
	]
});



/* data/index.js */

setTimeout(function() { console.log(notDefinedVariable); }, 1000);



Actual results:

When the content script is injected into a page and the timeout fires, I get the following log in my terminal and firefox error console.

error: An exception occurred.
Traceback (most recent call last):
[object Object]


Expected results:

Instead of [object Object] there should be a stack trace with the 'notDefinedVariable is not defined' message. When executing the following content script, I get the expected stack trace.

/* data/index.js */

console.log(notDefinedVariable);
I have the same issue. This is still not fixed and makes it nigh impossible to find the code throwing the exception.
There is also no additional output on Error Console or Firebug Console and I have not been able to find the offending code with venkman.
I have this issue as well. The following is the full output in both the terminal and Error Console in browser.

error: test-project: An exception occurred.
[object Object]
Traceback (most recent call last):
I have run into this issue multiple times now. Usually I have to spray console.log statements all over my code to find out in which file the exception occurred and then where in that file.

A lot of the time it is resolving an unknown symbol (like hello.world where hello = undefined). But I guess it could be any kind of exception.
With all changes were made to console and stacktrace, I think this bug can be closed as fixed: running the code proposed as example, I obtain:

console.error: test: 
  Message: ReferenceError: notDefinedVariable is not defined
  Stack:
    @resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///var/folders/tx/91xwh51562l5_4xcqjst9bvw0000gn/T/tmpPd1SJ5.mozrunner/extensions/jid1-V1kRlbNFgAbB0g@jetpack.xpi!/bootstrap.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/toolkit/loader.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/sdk/loader/sandbox.js -> resource://jid1-v1krlbnfgabb0g-at-jetpack/test/data/index.js:1:25
onFire@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///var/folders/tx/91xwh51562l5_4xcqjst9bvw0000gn/T/tmpPd1SJ5.mozrunner/extensions/jid1-V1kRlbNFgAbB0g@jetpack.xpi!/bootstrap.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/toolkit/loader.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/sdk/loader/sandbox.js -> resource://extensions.modules.jid1-v1krlbnfgabb0g-at-jetpack.commonjs.path/sdk/content/content-worker.js:153:11
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.