cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobia <tobia.confo...@linux.it>
Subject Calling map:handle-errors from flowscript
Date Wed, 27 Jun 2007 13:13:20 GMT
Hello

How can I invoke the default handler for, say, 404 Not Found errors from
my flowscript?

Sometimes I can only determine that a certain URL refers to a
non-existant resource from flowscript.  I'd like the user to see the
default error page configured in <map:handle-errors>

I've tried the following, but none of them seem to work:

	cocoon.sendStatus(404)
	cocoon.response.setStatus(404)
	cocoon.response.sendError(404)
	throw new Packages.java.io.FileNotFoundException()
	throw new Packages.org.apache.cocoon.ResourceNotFoundException("")

The problem with the (send|set)(Status|Error) is that they don't invoke
the exception handlers defined in the sitemap.  The problem with
throwing new exceptions is that they are wrapped in a JavaScriptException
and thus are reported as a 500 error, while I need a 404.

Any ideas?


Tobia

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message