def wrapper(f):
    def g(data):
        try:
            output = f(data)
            return XML(ouput)
        except (TypeError, ValueError), e:
            raise HTTP(405, '%s serialization error' % e)
        except ImportError, e:
            raise HTTP(405, '%s not available' % e)
        except Exception, e:
            raise HTTP(405, '%s error' % e)
    return g
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/generics.py/wrapper/original