code: def redirect_to_handler(error, location):
      
      if callable(location):
          location = location()
      request.environ['REQUEST_METHOD'] = 'GET'
      redirect(location, internal=True)
docs: Cause a requset with an error to internally redirect to a URI path.
  
      This is generally for internal use, but can be called from within a Pecan
      controller to trigger a validation failure from *within* the controller
      itself, e.g.::
  
          @expose()
          @validate(some_schema, '/some/handler')
          def some_controller(self, **kw):
              if some_bad_condition():
                  error_exception = ...
                  redirect_to_handler(error_exception, '/some/handler')