<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def redirect_to_handler(error, location):
 """ 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():
 redirect_to_handler(error_exception, '/some/handler') """

    if callable(location):
        location = location()
    request.environ['REQUEST_METHOD'] = 'GET'
    redirect(location, internal=True)