Coverage for python/lsst/daf/butler/registry/_exceptions.py: 100%
16 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-30 02:51 -0700
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-30 02:51 -0700
1# This file is part of daf_butler.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (http://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This software is dual licensed under the GNU General Public License and also
10# under a 3-clause BSD license. Recipients may choose which of these licenses
11# to use; please see the files gpl-3.0.txt and/or bsd_license.txt,
12# respectively. If you choose the GPL option then the following text applies
13# (but note that there is still no warranty even if you opt for BSD instead):
14#
15# This program is free software: you can redistribute it and/or modify
16# it under the terms of the GNU General Public License as published by
17# the Free Software Foundation, either version 3 of the License, or
18# (at your option) any later version.
19#
20# This program is distributed in the hope that it will be useful,
21# but WITHOUT ANY WARRANTY; without even the implied warranty of
22# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23# GNU General Public License for more details.
24#
25# You should have received a copy of the GNU General Public License
26# along with this program. If not, see <http://www.gnu.org/licenses/>.
29__all__ = (
30 "ArgumentError",
31 "CollectionExpressionError",
32 "CollectionTypeError",
33 "ConflictingDefinitionError",
34 "DataIdValueError",
35 "DatasetTypeExpressionError",
36 "InconsistentDataIdError",
37 "MissingSpatialOverlapError",
38 "NoDefaultCollectionError",
39 "OrphanedRecordError",
40 "RegistryConsistencyError",
41 "UnsupportedIdGeneratorError",
42 "UserExpressionError",
43 "UserExpressionSyntaxError",
44)
46from .._exceptions_legacy import CollectionError, DataIdError, RegistryError
49class ArgumentError(RegistryError):
50 """Exception raised when method arguments are invalid or inconsistent."""
53class DatasetTypeExpressionError(RegistryError):
54 """Exception raised for an incorrect dataset type expression."""
57class DataIdValueError(DataIdError):
58 """Exception raised when a value specified in a data ID does not exist."""
61class InconsistentDataIdError(DataIdError):
62 """Exception raised when a data ID contains contradictory key-value pairs,
63 according to dimension relationships.
64 """
67class CollectionTypeError(CollectionError):
68 """Exception raised when type of a collection is incorrect."""
71class CollectionExpressionError(CollectionError):
72 """Exception raised for an incorrect collection expression."""
75class NoDefaultCollectionError(CollectionError):
76 """Exception raised when a collection is needed, but collection argument
77 is not provided and default collection is not defined in registry.
78 """
81class UserExpressionError(RegistryError):
82 """Exception raised for problems with user expression."""
85class UserExpressionSyntaxError(UserExpressionError):
86 """Exception raised when a user query expression cannot be parsed."""
89class ConflictingDefinitionError(RegistryError):
90 """Exception raised when trying to insert a database record when a
91 conflicting record already exists.
92 """
95class OrphanedRecordError(RegistryError):
96 """Exception raised when trying to remove or modify a database record
97 that is still being used in some other table.
98 """
101class UnsupportedIdGeneratorError(ValueError):
102 """Exception raised when an unsupported `DatasetIdGenEnum` option is
103 used for insert/import.
104 """
107class MissingSpatialOverlapError(RegistryError):
108 """Exception raised when a spatial overlap relationship needed by a query
109 has not been precomputed and cannot be computed on-the-fly.
110 """
113class RegistryConsistencyError(RegistryError):
114 """Exception raised when an internal registry consistency check fails,
115 usually means bug in the Regitry itself.
116 """