On Sat, 2005-01-08 at 20:09 +0100, RadosÅaw Kintzi wrote:
> Is it a bug that ExceptionHandler does not set response status code to 500?
> I've got database served through HTTP protocol and by Webware behind
> Apache. And I've got a client application to that database. It is robot
> (works without user interaction). And I don't know how to find out, that
> the response contains data form database or html page with an error.

The HTTP spec says:

    Response status codes beginning with the digit "5" indicate cases in
    which the server is aware that it has erred or is incapable of
    performing the request.

    10.5.1 500 Internal Server Error

       The server encountered an unexpected condition which prevented it
       from fulfilling the request.

So yes, I think that it would make sense to return status code 500 when
an unhandled exception occurs.

> I wonder if  I can set status code in
> Webware-0.8.1/WebKit/ExceptionHandler.py:

> def work(self):
> ''' Invoked by __init__ to do the main work. '''

> if self._res:
> self._res.recordEndTime()
> self._time = self._res.endTime()
> self._res.setStatus(500, "Servlet
> Error")                       <------- Here is my code. It is a right
> way ???

It looks right to me.  Does it work?

peace,
Jason



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to