|
| 1 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | +# you may not use this file except in compliance with the License. |
| 3 | +# You may obtain a copy of the License at |
| 4 | +# |
| 5 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | +# |
| 7 | +# Unless required by applicable law or agreed to in writing, software |
| 8 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | +# See the License for the specific language governing permissions and |
| 11 | +# limitations under the License. |
| 12 | +# |
| 13 | +# SPDX-License-Identifier: Apache-2.0 |
| 14 | +# Copyright (c) OWASP Foundation. All Rights Reserved. |
| 15 | + |
| 16 | + |
| 17 | +""" |
| 18 | +Exceptions relating to specific conditions that occur when (de)serializing/(de)normalizing CycloneDX BOM. |
| 19 | +""" |
| 20 | + |
| 21 | +from . import CycloneDxException |
| 22 | + |
| 23 | + |
| 24 | +class CycloneDxSerializationException(CycloneDxException): |
| 25 | + """ |
| 26 | + Base exception that covers all exceptions that may be thrown during model serializing/normalizing. |
| 27 | + """ |
| 28 | + pass |
| 29 | + |
| 30 | + |
| 31 | +class CycloneDxDeserializationException(CycloneDxException): |
| 32 | + """ |
| 33 | + Base exception that covers all exceptions that may be thrown during model deserializing/denormalizing. |
| 34 | + """ |
| 35 | + pass |
| 36 | + |
| 37 | + |
| 38 | +class SerializationOfUnsupportedComponentTypeException(CycloneDxSerializationException): |
| 39 | + """ |
| 40 | + Raised when attempting serializing/normalizing a :py:class:`cyclonedx.model.component.Component` |
| 41 | + to a :py:class:`cyclonedx.schema.schema.BaseSchemaVersion` |
| 42 | + which does not support that :py:class:`cyclonedx.model.component.ComponentType` |
| 43 | + . |
| 44 | + """ |
| 45 | + |
| 46 | + |
| 47 | +class SerializationOfUnexpectedValueException(CycloneDxSerializationException, ValueError): |
| 48 | + """ |
| 49 | + Raised when attempting serializing/normalizing a type that is not expected there. |
| 50 | + """ |
0 commit comments