as2fm.as2fm_common.logging.check_assertion

as2fm.as2fm_common.logging.check_assertion(condition: bool, element: ~lxml.etree._Element, message: str, error_type: ~typing.Type[BaseException] = <class 'RuntimeError'>) None

Check if a condition holds, and raise an exception in case it doesn’t.

Parameters:
  • condition – The condition to evaluate. If False, an exception will be raised.

  • element – The element associated with the assertion, used for error context.

  • message – The error message to include in the raised exception.

  • error_type – The type of exception to raise if the condition is False.

Raises:

error_type – Raised when the condition is False, with the provided message.