Coverage for python/lsst/daf/butler/registry/_exceptions.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-11 03:15 -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/>. 

27 

28 

29__all__ = ( 

30 "ArgumentError", 

31 "CollectionExpressionError", 

32 "ConflictingDefinitionError", 

33 "DatasetTypeExpressionError", 

34 "MissingSpatialOverlapError", 

35 "NoDefaultCollectionError", 

36 "OrphanedRecordError", 

37 "RegistryConsistencyError", 

38 "UnsupportedIdGeneratorError", 

39 "UserExpressionError", 

40 "UserExpressionSyntaxError", 

41) 

42 

43from .._exceptions_legacy import CollectionError, RegistryError 

44 

45 

46class ArgumentError(RegistryError): 

47 """Exception raised when method arguments are invalid or inconsistent.""" 

48 

49 

50class DatasetTypeExpressionError(RegistryError): 

51 """Exception raised for an incorrect dataset type expression.""" 

52 

53 

54class CollectionExpressionError(CollectionError): 

55 """Exception raised for an incorrect collection expression.""" 

56 

57 

58class NoDefaultCollectionError(CollectionError): 

59 """Exception raised when a collection is needed, but collection argument 

60 is not provided and default collection is not defined in registry. 

61 """ 

62 

63 

64class UserExpressionError(RegistryError): 

65 """Exception raised for problems with user expression.""" 

66 

67 

68class UserExpressionSyntaxError(UserExpressionError): 

69 """Exception raised when a user query expression cannot be parsed.""" 

70 

71 

72class ConflictingDefinitionError(RegistryError): 

73 """Exception raised when trying to insert a database record when a 

74 conflicting record already exists. 

75 """ 

76 

77 

78class OrphanedRecordError(RegistryError): 

79 """Exception raised when trying to remove or modify a database record 

80 that is still being used in some other table. 

81 """ 

82 

83 

84class UnsupportedIdGeneratorError(ValueError): 

85 """Exception raised when an unsupported `DatasetIdGenEnum` option is 

86 used for insert/import. 

87 """ 

88 

89 

90class MissingSpatialOverlapError(RegistryError): 

91 """Exception raised when a spatial overlap relationship needed by a query 

92 has not been precomputed and cannot be computed on-the-fly. 

93 """ 

94 

95 

96class RegistryConsistencyError(RegistryError): 

97 """Exception raised when an internal registry consistency check fails, 

98 usually means bug in the Regitry itself. 

99 """