[Zope-dev] What to raise to generate an HTTP error response?
Michel Pelletier
michel@digicool.com
Mon, 8 Mar 1999 17:10:13 -0500
> -----Original Message-----
> From: skip@mojam.com [mailto:skip@mojam.com]
> Sent: Monday, March 08, 1999 1:52 PM
> To: zope-dev@zope.org
> Subject: [Zope-dev] What to raise to generate an HTTP error response?
>
>
>
> I have a Bobo/ZPublisher method that detects a missing file
> it needs. I
> want to return a 404 HTTP response. I know my method is
> supposed to raise
> something, but what? I know it must be in the docs
> somewhere, but I'll be
> damned if I've been able to find it. (I hope there's a Zope
> site search
> tool in the works. How about setting up Ultraseek or
> something similar in
> the meantime?)
>
Skip,
If your using 1.10.2 ZPublisher (previous versions I'm not sure of) Try
returning RESPONSE.notFoundError()
(lib/python/ZPublisher/HTTPResponse.py L437, probably in Response.py in
older versions of ZPublisher)
-Michel
> Thx,
>
> Skip Montanaro | Mojam: "Uniting the World of Music"
> http://www.mojam.com/
> skip@mojam.com | Musi-Cal: http://www.musi-cal.com/
> 518-372-5583
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://www.zope.org/mailman/listinfo/zope-dev
>
> (For non-developer, user-level issues, use the companion list,
> zope@zope.org, http://www.zope.org/mailman/listinfo/zope )
>