Neither of these return a error in the browser element, rather display an 
exception in the javascript console. In the documentation I could not find 
asyncOpen, the method you were refering to throw from, rather it was on the 
nsIChannel not nsIProtocolHandler. If I implement nsIChannel and throw will 
this return the standard file not found error? How do the other protocols 
return the error box or page? 

Another related issue, as I am returning a file channel when files are found, 
the actual file URL is stored in the history. Also this means that other files 
in the page try to load from the file protocol. How can I mask this? I'm 
guessing I need to implement nsIChannel?

Its good that your working to fix the first problem but I can't wait till then. 
 Thanks for the all the responses.
James.

[EMAIL PROTECTED] wrote: Send dev-tech-xpcom mailing list submissions to
 [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
 https://lists.mozilla.org/listinfo/dev-tech-xpcom
or, via email, send a message with subject or body 'help' to
 [EMAIL PROTECTED]

You can reach the person managing the list at
 [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dev-tech-xpcom digest..."


Today's Topics:

   1. Re: Protocol + When a the file is not found (James Newell)
   2. Re: Protocol + When a the file is not found (Boris Zbarsky)
   3. Re: Protocol + When a the file is not found (Christian Biesinger)
   4. Re: Protocol + When a the file is not found (Boris Zbarsky)


----------------------------------------------------------------------

Message: 1
Date: Fri, 22 Sep 2006 10:05:08 +1000 (EST)
From: James Newell 
Subject: Re: Protocol + When a the file is not found
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=iso-8859-1


Me again.

For some reason (js security?) no arguments are working and only the generic 
error message is being displayed with my about:neterror?e=... method.

In regard to Boris' suggested method:
I'm guessing that to throw from asyncOpen or call OnStopRequest, that I have to 
create a nsIStreamListener listener object and pass it to asyncOpen.
The thing is that I don't have a channel. I mean that under certain 
circumstances when a particular file is determined not exist, I have no URI to 
pass to create newChannel.
 If i'm wrong would u be able to provide a quick sample.
Thanks heaps,
James


Boris Zbarsky wrote:
>Throwing from asyncOpen should work, as should calling OnStopRequest 
with the 
correct error code.





----------------------------------------------
James Newell
[EMAIL PROTECTED]


   
---------------------------------
On Yahoo!7
  Messenger: Make free PC-to-PC calls to your friends overseas. 

------------------------------

Message: 2
Date: Thu, 21 Sep 2006 19:27:44 -0500
From: Boris Zbarsky 
Subject: Re: Protocol + When a the file is not found
To: [email protected]
Message-ID: 
Content-Type: text/plain; charset=KOI8-R; format=flowed

James Newell wrote:
> I'm guessing that to throw from asyncOpen

Yes.  From your protocol handler's asyncOpen.

> The thing is that I don't have a channel.

Thowing from newChannel is also fine.

> I mean that under certain circumstances when a particular file is determined 
> not exist, I have no URI to pass to create newChannel.

Throwing from newURI is also possible...

Put another way, you're implementing a protocol handler, right?  Gecko is what 
calls newURI, newChannel, asyncOpen on your code.  What are you returning to 
Gecko from those methods?

-Boris


------------------------------

Message: 3
Date: Thu, 21 Sep 2006 18:18:21 -0700
From: Christian Biesinger 
Subject: Re: Protocol + When a the file is not found
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=KOI8-R; format=flowed

Boris Zbarsky wrote:
> Thowing from newChannel is also fine.
> [...]
> Throwing from newURI is also possible...

You won't get an error page if you throw from newURI and IIRC not if you 
throw from newChannel either.


------------------------------

Message: 4
Date: Thu, 21 Sep 2006 21:07:43 -0500
From: Boris Zbarsky 
Subject: Re: Protocol + When a the file is not found
To: [email protected]
Message-ID: 
Content-Type: text/plain; charset=KOI8-R; format=flowed

Christian Biesinger wrote:
> You won't get an error page if you throw from newURI and IIRC not if you 
> throw from newChannel either.

For now.  But we're planning to fix at least the latter, last I checked.  And 
in 
both cases you _will_ get the appropriate error notification.

-Boris


------------------------------

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


End of dev-tech-xpcom Digest, Vol 9, Issue 21
*********************************************



----------------------------------------------
James Newell
[EMAIL PROTECTED]


                
---------------------------------
On Yahoo!7
  Messenger: Make free PC-to-PC calls to your friends overseas. 
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to