def __call__(self, request, trace): params = self.params(request) try: result = validate(self.schema, params) except ValidationError as e: raise HTTPBadRequest(e.error) else: self.update_trace(trace, result) return trace