-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.py
144 lines (99 loc) · 4.33 KB
/
errors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# pylint: disable=C0103, too-few-public-methods, locally-disabled, no-self-use, unused-argument
"""Custom errors for this package"""
class LayoutNotFound(ValueError):
"""Layout was not found"""
class MapNotFound(ValueError):
"""map not found"""
class MapFrameNotFound(ValueError):
"""mapframe not found"""
class ArcapiError(Exception):
"""A type of exception raised from arcapi module"""
class ReadOnlyError(Exception):
"""item is read only"""
class FieldExists(Exception):
"""The field already exists"""
class FieldNotFound(Exception):
""" Field not found"""
class FeatureClassOrTableNotFound(Exception):
""" The fc or table was not found """
class ShapeNotSupported(Exception):
"""shape not supported"""
class LayerNotFound(Exception):
""" The layer was not found - this is the ESRI layer entity and not the generic term
"""
# ORM Errors BEGIN
# ----------------
class ORMLogActionWasInvalid(Exception):
"""The ORM log action should be Delete, Add or Update"""
class ORMLogActionTableHasActionCol(Exception):
"""Cannot support ORM per-record logs The feature class has an 'action' column"""
class ORMLogTableColumnMismatch(Exception):
"""Columns exist in the feature class which are not in the log feature class"""
class ORMNoColumnsWereIdentifiedForReadOperation(Exception):
"""No columns for read"""
class ORMUpdateBeforeRead(Exception):
"""An update was called before a read and read_check was true. This could overwrite row values with None."""
class ORMMemberDoesNotExist(Exception):
"""ORM member does not exists"""
class DeleteHadNoMatchingRecords(Exception):
"""Delete had no records matching the specified key values"""
class DeleteHadNoOIDOrCompositeKey(Exception):
"""Delete could not execute as had no OID or composite key set"""
class DeleteMatchedMutlipleRecords(Exception):
"""Delete matched more than one record"""
class LookUpGotMoreThanOneRow(Exception):
"""A value lookup matched more than one row"""
class UpdateCursorGotMultipleRecords(Exception):
"""UpdateCursor had more than 1 record, and we told it this was bad"""
class UpdateMissingOIDOrCompositeKeyValues(Exception):
"""ORM Update operation was called, but the OID or Composite Key member(s) were invalid"""
class UpsertExpectedInsertButHadMatchedRow(Exception):
"""CRUD had no keyword arguments passed, but keylist found a matched row in the table or feature class"""
class UpsertExpectedUpdateButMatchedRow(Exception):
"""Upsert expected to update a record, but no record matched the key-value dict passed to the call"""
class FeatureClassMemberNamingClash(Exception):
"""The feature class or table has a column name which clashes with the ORM member naming convention"""
class EditOperationRolledBack(Exception):
"""An edit operation was rolled back"""
class CompositeKeyColumnsInvalid(Exception):
"""The definied composite key column names could not be found in the feature class/table"""
# END OF ORM ERRORS
# region struct.py errors
class StructMultipleFieldMatches(Exception):
"""Multiple fields matched, expected a single field match"""
class StructFieldExists(Exception):
"""Field already exists in table or featureclass"""
# end struct.py
# data.py errors
class DataNoRowsMatched(Exception):
"""No rows matched the query"""
class DataFieldValuesNotUnique(Exception):
"""Field values were not unique"""
class DataUnexpectedRowCount(Exception):
"""Expected a fixed rowcount, got different rowcount"""
class DataDeleteAllRowsWithNoWhere(Exception):
"""Delete all rows with now where clause"""
class DataUnknownKeywordsForTool(Exception):
""" An arcpy tool had unknown keywords"""
# endregion data.py
# display errors
class DisplayFeatureClassNotFound(Exception):
"""No feature class matched the feature class name"""
class DisplayFeatureClassNameMatchedMultipleLayers(Exception):
"""The feature class name matched more than one feature layer"""
# end display errors
########
# gdb #
########
class GDBExists(Exception):
"""GDB already exists"""
########
# geom #
########
class GeomInvalidTypeString(Exception):
"""Geometry type string invalid. Geometry strings are IN [point, polygon, polyline, or multipoint."""
########
# info #
########
class InfoMultiBandRasterNotSupported(Exception):
"""Multiband rasters are not supported"""