On Jan 6, 2008 3:10 PM, David King <[EMAIL PROTECTED]> wrote:
>
> > The next thing I am struggling with are error pages. Looking at vimagi
> > and wrotit, they respond with error pages if a record wasn´t found,
> > for example if you add a character to the end of a painting-detail on
> > vimagi, the site responds with a "Oops, this content doesn´t exist",
> > but the status in response headers is 200 ok instead of 404 Not found.
> > The same for wrotits post details. Maybe erlyweb should respond as
> > default with a 404 if no records are found and have an option to
> > disable this behaviour?
>
> erlyweb can't necessarily know that certain error conditions have
> occurred, and for the most part, I think this is one of them.
>
> That said, that wrotit doesn't respond with a 400-level error is a
> bug, and it's on my list. But the application has to signal that to
> erlyweb.
>
Same as in Vimagi. I think the app should set the status code, not ErlyWeb.
In Vimagi, the app controller has an 'error' hook that traps all the
exists from the application code. That hook is responsible for
displaying the error page. It should return
{response, [{status, 404}, ...]}
when the exit reason is a page not found exception (this is a Yaws
appmod return value)
Yariv
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---