Closed Bug 85572 Opened 23 years ago Closed 23 years ago

Javascript Error for each message sent

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: basic, Assigned: rginda)

Details

Attachments

(1 file)

Build 2001061120 win32 installer sea talkback
This javascript error appears in the Javascript console for each message sent 
by chatzilla:

Error: [Exception... "'Stream would block' when calling method: 
[nsIStreamProvider::onDataWritable]"  nsresult: "0x80470007 
(NS_BASE_STREAM_WOULD_BLOCK)"  location: "<unknown>"  data: no]
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Hardware: PC → All
The way the particular API that chatzilla uses to send messages requires that we
throw an exception to indicate we are done sending data.  In debug builds,
throwing an exception from a js component produces the debug message you're
seeing.  So, there's nothing going wrong, but the warning can get a bit annoying.

  The attached patch will keep the debug message from showing up for the
NS_BASE_STREAM_WOULD_BLOCK exception.

Looking for r/sr=

Index: src/xpcwrappedjsclass.cpp
===================================================================
RCS file: /cvsroot/mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp,v
retrieving revision 1.50
diff -u -r1.50 xpcwrappedjsclass.cpp
--- xpcwrappedjsclass.cpp       2001/05/18 23:35:03     1.50
+++ xpcwrappedjsclass.cpp       2001/06/14 01:01:27
@@ -75,7 +75,8 @@
 // this function is factored out to manage that.
 static inline JSBool IsReportableErrorCode(nsresult code)
 {
-    return NS_FAILED(code) && code != NS_ERROR_FACTORY_REGISTER_AGAIN;
+    return NS_FAILED(code) && code != NS_ERROR_FACTORY_REGISTER_AGAIN &&
+        code != NS_BASE_STREAM_WOULD_BLOCK;
 }
 
Status: NEW → ASSIGNED
I agree with what rginda is doing. His is a nice minimal change. I'm proposing 
something a little different (but functionally equivalent). I'm thinking it 
is better to make it clearer how this list of nsresults might grow by using a 
switch statement (and also be more efficent if the list gets big). 

The checkin process downside is that you'll need to get someone else to sr= it. 
vidur?
sr=vidur. I agree with John, error codes that aren't really errors are a Bad Thing.
r=rginda on jband's patch.  Asa, will you a=?
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Core → Other Applications
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: