Meshroom/meshroom/core/exception.py
Yann Lanthony 0adc4d8cc6 [core] add low-level retro-compatibility for attribute changes
First version of retrocompatibility, allowing to load files referencing removed or type-incompatible attributes.
* add node_factory to centralize node instantiation
* discard invalid attributes (i.e. not part of the node description anymore or with incompatible value type) when loading a file
* raise on unknown nodes
* add 'core.exception' module to declare Meshroom's exception types
2018-04-13 22:10:13 +02:00

22 lines
512 B
Python

#!/usr/bin/env python
# coding:utf-8
class MeshroomException(Exception):
""" Base class for Meshroom exceptions """
pass
class GraphException(MeshroomException):
""" Base class for Graph exceptions """
pass
class UnknownNodeTypeError(GraphException):
"""
Raised when asked to create a unknown node type.
"""
def __init__(self, nodeType):
msg = "Unknown Node Type: " + nodeType
super(UnknownNodeTypeError, self).__init__(msg)
self.nodeType = nodeType