'Command chain is called just like normal func.
This will call all funcs in chain with the same args as were given to
this function, and return the result of first func that didn\'t raise
TryNext'

def __call__(self, *args, **kw):

    last_exc = TryNext()
    for (prio, cmd) in self.chain:
        try:
            return cmd(*args, **kw)
        except TryNext as exc:
            last_exc = exc
    raise last_exc
