mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-18 03:26:30 +02:00
[core] add GraphVisitMessage exceptions mecanism
allow to stop branch or graph visit by throwing specific exceptions in visitor callbacks
This commit is contained in:
parent
52d1d1fb89
commit
ab4e82aa88
2 changed files with 27 additions and 3 deletions
|
@ -28,3 +28,18 @@ class NodeUpgradeError(GraphException):
|
|||
if details:
|
||||
msg += ": {}".format(details)
|
||||
super(NodeUpgradeError, self).__init__(msg)
|
||||
|
||||
|
||||
class GraphVisitMessage(GraphException):
|
||||
""" Base class for sending messages via exceptions during a graph visit. """
|
||||
pass
|
||||
|
||||
|
||||
class StopGraphVisit(GraphVisitMessage):
|
||||
""" Immediately interrupt graph visit. """
|
||||
pass
|
||||
|
||||
|
||||
class StopBranchVisit(GraphVisitMessage):
|
||||
""" Immediately stop branch visit. """
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue