def _failed(e): err = HTTPError() err.status_int = code body = StringIO() pprint(str(e), body) body.seek(0) err.body = body.read() raise err
def _check_type(self, type_, value, code): # XXX we should keep the value converted, no ? if type_ in self.types: try: self.types[type_](value) except ValueError, e: err = HTTPError() err.status_int = code body = StringIO() pprint(str(e), body) body.seek(0) err.body = body.read() raise err