Print to the console when loading a JS file fails. This cause us to print a message when a JS file included by XUL is missing.

This commit is contained in:
sfraser%netscape.com 2000-05-03 22:47:48 +00:00
Родитель 4413ab7059
Коммит 03cdcb6495
2 изменённых файлов: 42 добавлений и 0 удалений

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

@ -5061,6 +5061,27 @@ nsXULDocument::OnStreamComplete(nsIStreamLoader* aLoader,
PRUint32 stringLen,
const char* string)
{
// print a load error on bad status
if (NS_FAILED(aStatus))
{
if (aLoader)
{
nsCOMPtr<nsIChannel> channel;
aLoader->GetChannel(getter_AddRefs(channel));
if (channel)
{
nsCOMPtr<nsIURI> uri;
channel->GetURI(getter_AddRefs(uri));
if (uri)
{
char* uriSpec;
uri->GetSpec(&uriSpec);
printf("Failed to load %s\n", uriSpec ? uriSpec : "");
}
}
}
}
// This is the completion routine that will be called when a
// transcluded script completes. Compile and execute the script
// if the load was successful, then continue building content

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

@ -5061,6 +5061,27 @@ nsXULDocument::OnStreamComplete(nsIStreamLoader* aLoader,
PRUint32 stringLen,
const char* string)
{
// print a load error on bad status
if (NS_FAILED(aStatus))
{
if (aLoader)
{
nsCOMPtr<nsIChannel> channel;
aLoader->GetChannel(getter_AddRefs(channel));
if (channel)
{
nsCOMPtr<nsIURI> uri;
channel->GetURI(getter_AddRefs(uri));
if (uri)
{
char* uriSpec;
uri->GetSpec(&uriSpec);
printf("Failed to load %s\n", uriSpec ? uriSpec : "");
}
}
}
}
// This is the completion routine that will be called when a
// transcluded script completes. Compile and execute the script
// if the load was successful, then continue building content