Skip to content
Snippets Groups Projects
Unverified Commit e54ecd56 authored by Andrea Franchini's avatar Andrea Franchini
Browse files

fix exceptions constructor

parent b341fea9
Branches
No related tags found
No related merge requests found
...@@ -2,22 +2,22 @@ from mc_openapi.doml_mc.intermediate_model.metamodel import DOMLVersion ...@@ -2,22 +2,22 @@ from mc_openapi.doml_mc.intermediate_model.metamodel import DOMLVersion
class BadDOMLException(Exception): class BadDOMLException(Exception):
def __init__(self, message: str, *args: object) -> None: def __init__(self, message: str = None, *args: object) -> None:
super().__init__(*args) super().__init__(*args)
self.errors = message or "The submitted DOML contains some kind of error." self.errors = message or "The submitted DOML contains some kind of error."
class UnsupportedDOMLVersionException(Exception): class UnsupportedDOMLVersionException(Exception):
def __init__(self, message: str, *args: object) -> None: def __init__(self, message: str = None, *args: object) -> None:
super().__init__(*args) super().__init__(*args)
self.errors = message or "The DOML version is not supported." self.errors = message or "The DOML version is not supported."
class MissingInfrastructureLayerException(Exception): class MissingInfrastructureLayerException(Exception):
def __init__(self, message: str, *args: object) -> None: def __init__(self, message: str = None, *args: object) -> None:
super().__init__(*args) super().__init__(*args)
self.errors = message or "Abstract infrastructure layer is missing from DOML." self.errors = message or "Abstract infrastructure layer is missing from DOML."
class NoActiveConcreteLayerException(Exception): class NoActiveConcreteLayerException(Exception):
def __init__(self, message: str, *args: object) -> None: def __init__(self, message: str = None, *args: object) -> None:
super().__init__(*args) super().__init__(*args)
self.errors = message or "No active concrete infrastructure layer has been specified in DOML." self.errors = message or "No active concrete infrastructure layer has been specified in DOML."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment