[pmwiki-users] 404 on Abort?

Patrick R. Michaud pmichaud at pobox.com
Sat Jan 6 11:17:46 CST 2007


Just following up on a thread for the archives....

On Mon, Dec 04, 2006 at 08:06:29PM +0100, Mikael Nilsson wrote:
> mån 2006-12-04 klockan 13:00 -0600 skrev Patrick R. Michaud:
> > On Mon, Dec 04, 2006 at 07:27:53PM +0100, Mikael Nilsson wrote:
> > > Why doesn't pmwiki give 404 errors on Abort() ??
> > 
> > Hmm.  I agree that Abort() should probably return something
> > other than 200, but returning 404 (not found) doesn't seem
> > correct.  Most aborts are caused by things other than
> > the requested resource not being available, so we should
> > return a more appropriate error code.
> 
> Right, correct. In fact, different codes probably fit different
> situations, so an extra argument to Abort() might be handy.
> 
> 400 Bad Request
> 403 Forbidden
> 500 Internal Server Error

After thinking about it a lot more, I realized that returning
other status codes will actually make things a *lot* more difficult
for administrators using IE or IIS, and have decided against this.

As things stand now, when an Abort() occurs, PmWiki provides some 
indication of the reason for the abort, such as:

    Cannot acquire lockfile
    Cannot write page to $pagename...changes not saved
    ?unable to find skin from list
    ?unable to load $Skin template

But if we change the error code to be something other than "200 OK",
then Internet Explorer and IIS will often replace these error 
messages with their own "friendly" versions of the same message,
that don't provide any indication of the source of the error.
So, instead of seeing an error message like the ones above, the
administrator using IE or IIS simply sees "500 Internal Server Error",
which isn't very useful.

For example, the following screenshots show what Internet Explorer
displays when PmWiki's Abort() is returned with a "200 OK" versus
a "500 Internal Server" status code:

    # 200 OK
    http://www.pmwiki.org/pmwiki/uploads/PITS/ie-200.gif

    # 500 Internal Server Error
    http://www.pmwiki.org/pmwiki/uploads/PITS/ie-500.gif

It's pretty clear to me that the 200 result is a lot more useful
to an administrator than the 500, and since there are a fair
number of PmWiki administrators who are using IE or IIS, we'd make
things significantly more difficult for them by changing the
status codes on Abort().

In response to another thread I've changed PmWiki so that 
invalid page name requests result in "404 Not Found" errors,
but for the other abort conditions it seems best to leave things
as they are.

Thanks!

Pm




More information about the pmwiki-users mailing list