James Newell wrote:
The status code I get in onStopRequest when attempting to load a
document that does not exist is: 2147500037 - NS_ERROR_FAILURE
according to "http://twpol.dyndns.org/mozilla/misc/nserror?0x804b000a";

Ah. Yeah.... So I just checked and the status codes that docshell will report (via a dialog or errore page) are:

NS_ERROR_FILE_NOT_FOUND
NS_ERROR_INVALID_CONTENT_ENCODING
NS_ERROR_UNKNOWN_HOST
NS_ERROR_NET_RESET
NS_ERROR_CONNECTION_REFUSED
NS_ERROR_UNKNOWN_PROXY_HOST
NS_ERROR_PROXY_CONNECTION_REFUSED
NS_ERROR_NET_TIMEOUT
NS_ERROR_REDIRECT_LOOP
NS_ERROR_UNKNOWN_SOCKET_TYPE
NS_ERROR_NET_INTERRUPT
NS_ERROR_DOCUMENT_NOT_CACHED

In all cases, the error code needs to be seen by nsDocShell::OnStateChange, which means the channel needs to be in the loadgroup.

I can post the code if you wish. No I'm not adding my channel or the
wrapped one to the load group. I don't understand how this works. Is
there any documentation/examples other than the interface reference.

Basically, the channel should keep track of its loadgroup (set via SetLoadGroup on it). Whenever it's pending, it should be in the loadgroup. So typically in your AsyncOpen method you would add your channel to the loadgroup, and when you're about to call OnStopRequest on your listener you would remove yourself from the loadgroup. When removing, pass the error status you want (in this case NS_ERROR_FILE_NOT_FOUND) to removeRequest.

Boris said in an earlier reply that passing NS_ERROR_FILE_NOT_FOUND to
onStopRequest would display the default error message

Yeah, I was apparently confused.  :(  I hope what I say above is more correct...

-Boris
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to