Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Components.utils.reportError?

82 views
Skip to first unread message

us...@domain.invalid

unread,
Nov 16, 2006, 11:32:09 AM11/16/06
to
I have written a little add-on that runs in both FF 2 and T-Bird
1.5.0.8. In my code I call Components.utils.reportError() and pass in a
string. This is NOT inside a catch clause. I note that in T-Bird, the
string is shown in the JavaScript Console available from the Tools menu.
However, in FF's ErrorConsole available from the Tools menu, I do not
see any entry.

Any idea what is going wrong here?

Myk Melez

unread,
Nov 16, 2006, 1:28:05 PM11/16/06
to

Perhaps you don't have the javascript.options.showInConsole preference
enabled?

-myk

Eric H. Jung

unread,
Nov 16, 2006, 1:52:28 PM11/16/06
to dev-ext...@lists.mozilla.org
Maybe you've clicked the "Warnings" or "Messages" filter button in the Firefox JS Error Console but not Thunderbird? Make sure "Errors" or "All" is clicked instead.

----- Original Message ----
From: "us...@domain.invalid" <us...@domain.invalid>
To: dev-ext...@lists.mozilla.org
Sent: Thursday, November 16, 2006 11:32:09 AM
Subject: Components.utils.reportError?

I have written a little add-on that runs in both FF 2 and T-Bird
1.5.0.8. In my code I call Components.utils.reportError() and pass in a
string. This is NOT inside a catch clause. I note that in T-Bird, the
string is shown in the JavaScript Console available from the Tools menu.
However, in FF's ErrorConsole available from the Tools menu, I do not
see any entry.

Any idea what is going wrong here?

_______________________________________________
dev-extensions mailing list
dev-ext...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-extensions

us...@domain.invalid

unread,
Nov 16, 2006, 1:55:42 PM11/16/06
to

Thanks so much! Seems this is on by default in T-Bird (config editor
shows it = true but NOT highlighted) and off by default in FF. Go
figure! Anyhow, this is working now.

However, using the console service's logStringMessage() seems to place
an entry regardless of the setting of this option. So it may be better
to use that service for errors as well since it works regardless of this
setting.

Cheers!

Myk Melez

unread,
Nov 16, 2006, 2:12:14 PM11/16/06
to
us...@domain.invalid wrote:

> Thanks so much! Seems this is on by default in T-Bird (config editor
> shows it = true but NOT highlighted) and off by default in FF. Go
> figure! Anyhow, this is working now.
>
> However, using the console service's logStringMessage() seems to place
> an entry regardless of the setting of this option. So it may be better
> to use that service for errors as well since it works regardless of this
> setting.

That may be true for string messages, but reportError() handles
exceptions in addition to text strings, so it's preferable inside
catch() statements or anywhere you don't know if you're getting a string
or an exception.

In fact, I'd venture to assert that it's better to use reportError()
even when you know you're getting a string, since then you don't bother
users who don't necessarily want to know about errors in your code.

-myk

Eric H. Jung

unread,
Nov 16, 2006, 3:31:23 PM11/16/06
to dev-ext...@lists.mozilla.org
Don't forget there's always plain old dump() for logging to stdout. Users must start with -console and turn on a pref in order to see any messages. Primitive but effective (like me).

----- Original Message ----
From: Myk Melez <m...@mozilla.org>
To: dev-ext...@lists.mozilla.org

us...@domain.invalid wrote:

-myk

æric

unread,
Nov 16, 2006, 11:57:51 PM11/16/06
to
Just because I'm curious about most everything, I tried starting FF2 (WinXP)
with -console as a command-line option and got a spare window titled
"Firefox" that said "installing flashblock" (which I am assuming is the
console window...), but in the error console it told me:
Error: Warning: unrecognized command line flag -console
Source File:
file:///C:/Program%20Files/Mozilla/FireFox/components/nsBrowserContentHandler.js
Line: 588

Seemed kinda odd considering I THINK it worked...
Any ideas?
æric

"Eric H. Jung" <eric...@yahoo.com> wrote in message
news:mailman.1124.11637090...@lists.mozilla.org...

Nickolay Ponomarev

unread,
Nov 17, 2006, 5:05:34 AM11/17/06
to æric, dev-ext...@lists.mozilla.org
That's a known bug. Ignore that message.
Nickolay

0 new messages