Closed Bug 88460 Opened 23 years ago Closed 22 years ago

nsIWebProgressListener method implementations often return errors.

Categories

(Core Graveyard :: Embedding: APIs, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 46856
mozilla1.0

People

(Reporter: jst, Assigned: rpotts)

References

Details

(Keywords: embed, topembed-)

Most of our implementations of nsIWebProgressListener::OnSecurityChange() return NS_ERROR_NOT_IMPLEMENTED just because they don't know what to do in that notification. This is stupid, calling any of these methods from JS causes an exception to be thrown just because the implementation doesn't care about this notification, that makes no sense what so ever. This code should be cleaned up, I bet there are other methods in this interface (and probably other interfaces too :-) whose implementations do the same thing, for no good reason. What's wrong about simply returning NS_OK in notification methods where nothing needs to be done? :-)
What's the use of having NS_ERROR_NOT_IMPLEMENTED at all then?
Target Milestone: --- → mozilla0.9.8
I believe that the issue is that these 'particular' observers should *never* return an error code. these observers receive notifications, so if they do not want to 'implement' a particular notification then NS_OK should be returned. error codes should be reserved for low-level subsystems such as XPConnect (or the proxy code) to indicate that there was a failure to *deliver* the notification. we really need to define thses types of return code semantics. I believe that for most types of 'observers' the semantics should be that NS_FAILURE indicates a failure to *deliver* the notification. Not that the observer implementation returned a failure... -- rick
Jud, returning NS_ERROR_NOT_IMPLEMENTED (i.e. throwing an exception) from a method that you know will be called from some other sub-system is just wrong. NS_ERROR_NOT_IMPLEMENTED should be used with extreme caution and only in methods that shouldn't even be called, we of course abuse this all over. I couldn't agree more with Rick.
Target Milestone: mozilla0.9.8 → mozilla0.9.9
this will actually be addressed by 46856
Depends on: 46856
change qa contact to depstein
QA Contact: mdunn → depstein
Moving Netscape owned 0.9.9 and 1.0 bugs that don't have an nsbeta1, nsbeta1+, topembed, topembed+, Mozilla0.9.9+ or Mozilla1.0+ keyword. Please send any questions or feedback about this to adt@netscape.com. You can search for "Moving bugs not scheduled for a project" to quickly delete this bugmail.
Target Milestone: mozilla0.9.9 → mozilla1.2
Keywords: topembed+
Target Milestone: mozilla1.2 → mozilla1.0
The changes for this bug are rolled up in the patch for bug #46856.
Keywords: topembed+embed, topembed-
QA Contact: depstein → carosendahl
*** This bug has been marked as a duplicate of 46856 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Verified
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.