cyclonedx.exception.model

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

Classes

CycloneDxModelException

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

InvalidValueException

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

InvalidLocaleTypeException

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

InvalidNistQuantumSecurityLevelException

Raised when an invalid value is provided for an NIST Quantum Security Level

InvalidOmniBorIdException

Raised when a supplied value for an OmniBOR ID does not meet the format requirements

InvalidRelatedCryptoMaterialSizeException

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

InvalidSwhidException

Raised when a supplied value for an Swhid does not meet the format requirements

InvalidUriException

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

MutuallyExclusivePropertiesException

Raised when mutually exclusive properties are provided.

NoPropertiesProvidedException

Raised when attempting to construct a model class and providing NO values (where all properites are defined as

UnknownComponentDependencyException

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

UnknownHashTypeException

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

LicenseExpressionAlongWithOthersException

Exception raised when a LicenseExpression was detected along with other licenses.

InvalidCreIdException

Raised when a supplied value for an CRE ID does not meet the format requirements

InvalidConfidenceException

Raised when an invalid value is provided for a Confidence.

Module Contents

class cyclonedx.exception.model.CycloneDxModelException

Bases: cyclonedx.exception.CycloneDxException

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

class cyclonedx.exception.model.InvalidValueException

Bases: CycloneDxModelException

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

class cyclonedx.exception.model.InvalidLocaleTypeException

Bases: 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.

class cyclonedx.exception.model.InvalidNistQuantumSecurityLevelException

Bases: 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).

class cyclonedx.exception.model.InvalidOmniBorIdException

Bases: 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.

class cyclonedx.exception.model.InvalidRelatedCryptoMaterialSizeException

Bases: CycloneDxModelException

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

class cyclonedx.exception.model.InvalidSwhidException

Bases: 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.

class cyclonedx.exception.model.InvalidUriException

Bases: CycloneDxModelException

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

class cyclonedx.exception.model.MutuallyExclusivePropertiesException

Bases: CycloneDxModelException

Raised when mutually exclusive properties are provided.

class cyclonedx.exception.model.NoPropertiesProvidedException

Bases: 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).

class cyclonedx.exception.model.UnknownComponentDependencyException

Bases: CycloneDxModelException

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

class cyclonedx.exception.model.UnknownHashTypeException

Bases: CycloneDxModelException

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

class cyclonedx.exception.model.LicenseExpressionAlongWithOthersException

Bases: 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

class cyclonedx.exception.model.InvalidCreIdException

Bases: CycloneDxModelException

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

class cyclonedx.exception.model.InvalidConfidenceException

Bases: CycloneDxModelException

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