2

I use my own class X, that has api attribute which is ServerProxy from xmlrpclib. It looks more or less like this:

class X:
    def __init__(self):
        self.api = xmlrpclib(...)

I call a lot of xmlrequests by self.api.something(), but I'd like to parse response and if I find errorcode defined by my custom API (For example response looks like: ERROR CODE 0001), I'd like to raise custom Exception. otherwise return result.

One idea I had is to somehow derive by ServerProxy, but tbh. I have no idea how to do that correctly, so it works in given situation.

Gricha
  • 1,044
  • 3
  • 11
  • 26

0 Answers0