Closed Bug 579487 Opened 14 years ago Closed 14 years ago

Better error reporting when NS_CreateServicesFromCategory can't find a contract

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b2

People

(Reporter: benjamin, Assigned: benjamin)

Details

Attachments

(1 file, 1 obsolete file)

One of the common issues that's showing up with extension authors and profile-after-change is that they can't debug issues in the category registration. A simple aid is to report errors where a category entry exists in profile-after-change but the service either cannot be created or does not implement nsIObserver properly.
Attachment #457933 - Flags: review?(dtownsend)
Attachment #457933 - Attachment is obsolete: true
Attachment #457936 - Flags: review?(dtownsend)
Attachment #457933 - Flags: review?(dtownsend)
Comment on attachment 457936 [details] [diff] [review]
NS_CreateServicesFromCategory error reporting to the console, rev. 1

I have slight concerns with this. I have seen cases where extensions add profile-after-change services but don't implement nsIObserver, they should do what they want in their constructor.

I even recall making an odd suggestion the other day for someone that wanted do something at profile-after-change without keeping a service alive for the entire app where I suggested their factory simply do whatever startup they wanted and then not return an instance.

Both of these case would throw errors even though they are sort of intentional. I don't think it is a big deal just wonder how many cases like this there are going to be filling up the console.
Attachment #457936 - Flags: review?(dtownsend) → review+
http://hg.mozilla.org/mozilla-central/rev/c271aa43c7ab
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: