Closed
Bug 88460
Opened 23 years ago
Closed 22 years ago
nsIWebProgressListener method implementations often return errors.
Categories
(Core Graveyard :: Embedding: APIs, defect)
Core Graveyard
Embedding: APIs
Tracking
(Not tracked)
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? :-)
Comment 1•23 years ago
|
||
What's the use of having NS_ERROR_NOT_IMPLEMENTED at all then?
Target Milestone: --- → mozilla0.9.8
Assignee | ||
Comment 2•23 years ago
|
||
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
Reporter | ||
Comment 3•23 years ago
|
||
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.
Updated•23 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Comment 6•23 years ago
|
||
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
Assignee | ||
Comment 7•23 years ago
|
||
The changes for this bug are rolled up in the patch for bug #46856.
Updated•23 years ago
|
Updated•22 years ago
|
QA Contact: depstein → carosendahl
Comment 8•22 years ago
|
||
*** This bug has been marked as a duplicate of 46856 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•