Closed Bug 334558 Opened 14 years ago Closed 6 years ago
IService Manager::is Service Instantiated* methods throw, but are not documented to do so
The implementations on nsComponentManager of nsIServiceManager::isServiceInstantiated and nsIServiceManager::isServiceInstantiatedByContractID throw more often than the interface documentation says they should. Essentially, they're methods that return a boolean, but in reality either: * succeed and return true, or * throw. See bug 331120 comment 4 for more details. Probably they should propagate return values a good bit less, and perhaps never throw at all. But if it's decided to leave the behavior as is, the interface documentation should at least be corrected.
Would making the two implementations not throw at all be OK? As far as I can tell only /mail/components/about-support/content/a11y.js and /toolkit/modules/Troubleshoot.jsm use either method, and both have to work around the issue...
Given that the behavior since 2006 has been to throw, we should keep throwing and update the documentation.
I'm not sure if the NS_ERROR_UNEXPECTED case is relevant / NS_ERROR_UNEXPECTED is thrown at all, so I've left it out for now... I will also update the MDN docs afterwards.
Assignee: nobody → cykesiopka.bmo
Status: NEW → ASSIGNED
Attachment #772918 - Flags: review?(benjamin)
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.