1 2 -class VisGraphException(Exception): 3 pass 4 5 -class DuplicateNode(VisGraphException): 6 - def __init__(self, node): 7 Exception.__init__(self, repr(node)) 8 self.node = node 9 10 -class NodeNonExistant(VisGraphException): 11 - def __init__(self, nodeid): 12 self.nodeid = nodeid 13 Exception.__init__(self, 'Node %d does not exist!' % nodeid) 14 15 -class EdgeNonExistant(VisGraphException): 16 - def __init__(self, nodeid): 17 self.edgeid = edgeid 18 Exception.__init__(self, 'Edge %d does not exist!' % nodeid) 19