:py:mod:`cyclonedx.exception.model`
===================================

.. py:module:: cyclonedx.exception.model

.. autoapi-nested-parse::

   Exceptions relating to specific conditions that occur when modelling CycloneDX BOM.



Module Contents
---------------

.. py:exception:: CycloneDxModelException


   Bases: :py:obj:`cyclonedx.exception.CycloneDxException`

   Base exception that covers all exceptions that may be thrown during model creation.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidValueException


   Bases: :py:obj:`CycloneDxModelException`

   Base exception that covers all exceptions that may be thrown during model creation.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidLocaleTypeException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when the supplied locale does not conform to ISO-639 specification.

   Good examples:
       - en
       - en-US
       - en-GB
       - fr
       - fr-CA

   The language code MUST be lowercase. If the country code is specified, the country code MUST be upper case.
   The language code and country code MUST be separated by a minus sign.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidNistQuantumSecurityLevelException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when an invalid value is provided for an NIST Quantum Security Level
   as defined at https://csrc.nist.gov/projects/post-quantum-cryptography/post-quantum-cryptography-standardization/
   evaluation-criteria/security-(evaluation-criteria).

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidOmniBorIdException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when a supplied value for an OmniBOR ID does not meet the format requirements
   as defined at https://www.iana.org/assignments/uri-schemes/prov/gitoid.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidRelatedCryptoMaterialSizeException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when the supplied size of a Related Crypto Material is negative.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidSwhidException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when a supplied value for an Swhid does not meet the format requirements
   as defined at https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidUriException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when a `str` is provided that needs to be a valid URI, but isn't.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: MutuallyExclusivePropertiesException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when mutually exclusive properties are provided.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: NoPropertiesProvidedException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when attempting to construct a model class and providing NO values (where all properites are defined as
   Optional, but at least one is required).

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: UnknownComponentDependencyException


   Bases: :py:obj:`CycloneDxModelException`

   Exception raised when a dependency has been noted for a Component that is NOT a Component BomRef in this Bom.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: UnknownHashTypeException


   Bases: :py:obj:`CycloneDxModelException`

   Exception raised when we are unable to determine the type of hash from a composite hash string.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: LicenseExpressionAlongWithOthersException


   Bases: :py:obj:`CycloneDxModelException`

   Exception raised when a LicenseExpression was detected along with other licenses.
   If a LicenseExpression exists, than it must stand alone.

   See https://github.com/CycloneDX/specification/pull/205

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidCreIdException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when a supplied value for an CRE ID does not meet the format requirements
   as defined at https://opencre.org/

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



.. py:exception:: InvalidConfidenceException


   Bases: :py:obj:`CycloneDxModelException`

   Raised when an invalid value is provided for a Confidence.
   The confidence of the evidence from 0 - 1, where 1 is 100% confidence.

   .. py:class:: args



   .. py:method:: add_note()

      Exception.add_note(note) --
      add a note to the exception


   .. py:method:: with_traceback()

      Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.



