def __getattr__(self, name):
        func = getattr(self.__dict__['obj'], name)
        if callable(func):
            def my_wrapper(*args, **kwargs):
                try:
                    ret = func(*args, **kwargs)
                except JSONRPCException as e:
                    return e.error
                else:
                    return ret
            return my_wrapper
        else:
            return func
changes the behavior of underlying authproxy to return the error
dataset/ETHPy150Open blockstack/pybitcoin/pybitcoin/rpc/bitcoind_client.py/BitcoindClient.__getattr__