Maybe your _q_lookup should raise a TraversalError and a _q_exception_handler should produce the error page you want.