Exceptions ========== All pybergshamra exceptions inherit from :class:`BergshamraError`, which itself inherits from Python's built-in :class:`Exception`. .. exception:: BergshamraError Base exception for all pybergshamra errors. Catch this to handle any error from the library. .. code-block:: python import pybergshamra try: pybergshamra.verify(ctx, xml) except pybergshamra.BergshamraError as e: print(f"Something went wrong: {e}") .. exception:: XmlError Raised when XML parsing or structural validation fails -- for example, malformed XML input or a missing required element. .. code-block:: python import pybergshamra try: pybergshamra.verify(ctx, "