bug 85572, "Javascript Error for each message sent"; patch=jband, r=me, sr=vidur, a=asa

xpconnect had been printing it's large "js component threw exception" whenever chatzilla's socket code threw NS_BASE_STREAM_WOULD_BLOCK from it's streamprovider (a non-error nsresult, bah.)  This patch adds the exception to the "suppression list", to quiet the debug message.
This commit is contained in:
rginda%netscape.com 2001-06-19 22:53:36 +00:00
Родитель fc9674ef6a
Коммит 88cf53654a
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -72,10 +72,21 @@ static inline void DoPostScriptEvaluated(JSContext* cx)
}
// It turns out that some errors may be not worth reporting. So, this
// this function is factored out to manage that.
// function is factored out to manage that.
static inline JSBool IsReportableErrorCode(nsresult code)
{
return NS_FAILED(code) && code != NS_ERROR_FACTORY_REGISTER_AGAIN;
if(NS_SUCCEEDED(code))
return JS_FALSE;
switch(code)
{
// Error codes that we don't want to report as errors...
// These generally indicate bad interface design AFAIC.
case NS_ERROR_FACTORY_REGISTER_AGAIN:
case NS_BASE_STREAM_WOULD_BLOCK:
return JS_FALSE;
}
return JS_TRUE;
}
// static