Fix for bug 7401. Output an error when a URL load fails.

This commit is contained in:
nisheeth%netscape.com 1999-06-11 23:10:59 +00:00
parent aad43df1e7
commit c62e745099
3 changed files with 60 additions and 3 deletions

View File

@ -733,9 +733,18 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
Cleanup(key, aLoadData);
}
}
else { // load failed, cleanup
else { // load failed, cleanup
URLKey key(aLoadData->mURL);
Cleanup(key, aLoadData);
// Dump error message to console.
const char *url;
if (nsnull != aLoadData->mURL)
aLoadData->mURL->GetSpec(&url);
else
url = "";
cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url
<< "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n";
}
}
@ -1193,6 +1202,16 @@ CSSLoaderImpl::LoadAgentSheet(nsIURL* aURL,
}
NS_RELEASE(in);
}
else {
// Dump an error message to the console
const char *url;
if (nsnull != aURL)
aURL->GetSpec(&url);
else
url = "";
cerr << "CSSLoaderImpl::LoadAgentSheet: Load of URL '" << url
<< "' failed. Error code: " << NS_ERROR_GET_CODE(result) << "\n";
}
}
}
return result;

View File

@ -733,9 +733,18 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
Cleanup(key, aLoadData);
}
}
else { // load failed, cleanup
else { // load failed, cleanup
URLKey key(aLoadData->mURL);
Cleanup(key, aLoadData);
// Dump error message to console.
const char *url;
if (nsnull != aLoadData->mURL)
aLoadData->mURL->GetSpec(&url);
else
url = "";
cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url
<< "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n";
}
}
@ -1193,6 +1202,16 @@ CSSLoaderImpl::LoadAgentSheet(nsIURL* aURL,
}
NS_RELEASE(in);
}
else {
// Dump an error message to the console
const char *url;
if (nsnull != aURL)
aURL->GetSpec(&url);
else
url = "";
cerr << "CSSLoaderImpl::LoadAgentSheet: Load of URL '" << url
<< "' failed. Error code: " << NS_ERROR_GET_CODE(result) << "\n";
}
}
}
return result;

View File

@ -733,9 +733,18 @@ CSSLoaderImpl::DidLoadStyle(nsIUnicharStreamLoader* aLoader,
Cleanup(key, aLoadData);
}
}
else { // load failed, cleanup
else { // load failed, cleanup
URLKey key(aLoadData->mURL);
Cleanup(key, aLoadData);
// Dump error message to console.
const char *url;
if (nsnull != aLoadData->mURL)
aLoadData->mURL->GetSpec(&url);
else
url = "";
cerr << "CSSLoaderImpl::DidLoadStyle: Load of URL '" << url
<< "' failed. Error code: " << NS_ERROR_GET_CODE(aStatus) << "\n";
}
}
@ -1193,6 +1202,16 @@ CSSLoaderImpl::LoadAgentSheet(nsIURL* aURL,
}
NS_RELEASE(in);
}
else {
// Dump an error message to the console
const char *url;
if (nsnull != aURL)
aURL->GetSpec(&url);
else
url = "";
cerr << "CSSLoaderImpl::LoadAgentSheet: Load of URL '" << url
<< "' failed. Error code: " << NS_ERROR_GET_CODE(result) << "\n";
}
}
}
return result;