Skip to content

exceptions

xsdata.codegen.exceptions

CodegenWarning

Bases: Warning

Recovered errors during code generation recovered errors.

Source code in xsdata/codegen/exceptions.py
6
7
class CodegenWarning(Warning):
    """Recovered errors during code generation recovered errors."""

CodegenError

Bases: ClickException

Unexpected state during code generation related errors.

Source code in xsdata/codegen/exceptions.py
10
11
12
13
14
15
16
17
18
19
20
21
22
class CodegenError(ClickException):
    """Unexpected state during code generation related errors."""

    def __init__(self, message: str, **kwargs: Any):
        super().__init__(message)
        self.meta = kwargs

    def show(self, file: Optional[IO[Any]] = None):
        """Echo codegen error message and details."""
        echo("=========")
        super().show(file)
        for key, value in self.meta.items():
            echo(f"{key}: {value}")

show(file=None)

Echo codegen error message and details.

Source code in xsdata/codegen/exceptions.py
17
18
19
20
21
22
def show(self, file: Optional[IO[Any]] = None):
    """Echo codegen error message and details."""
    echo("=========")
    super().show(file)
    for key, value in self.meta.items():
        echo(f"{key}: {value}")