зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ddfcd21b45
Коммит
170f02a59e
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче