Skip to content

Commit bf63bb0

Browse files
Remove specific API errors
1 parent b0a65f8 commit bf63bb0

File tree

3 files changed

+26
-865
lines changed

3 files changed

+26
-865
lines changed

pyslicer/core/handler_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _raise_error(self):
1414
"""Find API error."""
1515
code_error = int(self.result['errors'][0]['code'])
1616
exception = slicer_exceptions[code_error]
17-
raise exception(self.result['errors'][0]['message'])
17+
raise exception(**self.result['errors'][0])
1818

1919
def request_successful(self):
2020
"""Returns true if request was successful

pyslicer/core/helper_handler_exceptions.py

Lines changed: 5 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -7,126 +7,11 @@
77

88

99
__mapped_errors = {
10-
# Authentication and Authorization errors (10 - 19)
11-
10: exceptions.AuthMissingHeaderException,
12-
11: exceptions.AuthAPIKeyException,
13-
12: exceptions.AuthInvalidAPIKeyException,
14-
13: exceptions.AuthIncorrectPermissionException,
15-
14: exceptions.AuthInvalidRemoteException,
16-
15: exceptions.CustomKeyInvalidColumnCreationException,
17-
16: exceptions.CustomKeyInvalidPermissionForColumnException,
18-
17: exceptions.CustomKeyInvalidOperationException,
19-
18: exceptions.CustomKeyNotPermittedException,
20-
19: exceptions.CustomKeyRouteNotPermittedException,
21-
20: exceptions.DemoApiInvalidEndpointException,
22-
# Request validations (21 - 29)
23-
21: exceptions.RequestMissingContentTypeException,
24-
22: exceptions.RequestIncorrectContentTypeValueException,
25-
23: exceptions.RequestRateLimitException,
26-
24: exceptions.RequestInvalidJsonException,
27-
25: exceptions.RequestInvalidHttpMethodException,
28-
26: exceptions.RequestInvalidEndpointException,
29-
27: exceptions.RequestIncorrectHttpException,
30-
28: exceptions.RequestExceedLimitException,
31-
# Account Errors (30 - 39)
32-
30: exceptions.AccountMissingPaymentMethodException,
33-
31: exceptions.AccountPaymentRequiredException,
34-
32: exceptions.AccountBannedException,
35-
33: exceptions.AccountDisabledException,
36-
39: exceptions.ColumnInvalidRangeException,
37-
# Column errors (40 - 59)
38-
40: exceptions.ColumnMissingParamException,
39-
41: exceptions.ColumnTypeException,
40-
42: exceptions.ColumnIntegerValuesException,
41-
43: exceptions.ColumnAlreadyExistsException,
42-
44: exceptions.ColumnLimitException,
43-
45: exceptions.ColumnTimeSeriesLimitException,
44-
46: exceptions.ColumnTimeSeriesSystemLimitException,
45-
47: exceptions.ColumnDecimalTypeException,
46-
48: exceptions.ColumnStorageValueException,
47-
49: exceptions.ColumnInvalidApiNameException,
48-
50: exceptions.ColumnInvalidNameException,
49-
51: exceptions.ColumnInvalidDescriptionException,
50-
52: exceptions.ColumnExceedDescriptionlengthException,
51-
53: exceptions.ColumnInvalidCardinalityException,
52-
54: exceptions.ColumnDecimalLimitException,
53-
55: exceptions.ColumnRangeLimitException,
54-
56: exceptions.ColumnExceededMaxNameLenghtException,
55-
57: exceptions.ColumnExceededMaxApiNameLenghtException,
56-
58: exceptions.ColumnEmptyEntityIdException,
57-
59: exceptions.ColumnExceededPermitedValueException,
58-
# Insertion errors (60 - 79)
59-
60: exceptions.InsertInvalidDecimalPlacesException,
60-
61: exceptions.InsertEntityValueTypeException,
61-
62: exceptions.InsertColumnNameTypeException,
62-
63: exceptions.InsertColumnTypeException,
63-
64: exceptions.InsertEntityNameTooBigException,
64-
65: exceptions.InsertColumnValueTooBigException,
65-
66: exceptions.InsertTimeSeriesDateFormatException,
66-
67: exceptions.InsertColumnNotActiveException,
67-
68: exceptions.InsertIdLimitException,
68-
69: exceptions.InsertColumnLimitException,
69-
70: exceptions.InsertDateFormatException,
70-
71: exceptions.InsertColumnStringEmptyValueException,
71-
72: exceptions.InsertColumnTimeSeriesInvalidParameterException,
72-
73: exceptions.InsertColumnNumericInvalidValueException,
73-
74: exceptions.InsertColumnTimeSeriesMissingValueException,
74-
75: exceptions.QueryTimeSeriesInvalidPrecisionSecondsException,
75-
76: exceptions.QueryTimeSeriesInvalidPrecisionMinutesException,
76-
77: exceptions.QueryTimeSeriesInvalidPrecisionHoursException,
77-
78: exceptions.QueryDateFormatException,
78-
79: exceptions.QueryRelativeIntervalException,
79-
# Query errors (80 - 109)
80-
80: exceptions.QueryMissingQueryException,
81-
81: exceptions.QueryInvalidTypeException,
82-
82: exceptions.QueryMissingTypeParamException,
83-
83: exceptions.QueryInvalidOperatorException,
84-
84: exceptions.QueryIncorrectOperatorUsageException,
85-
85: exceptions.QueryColumnNotActiveException,
86-
86: exceptions.QueryMissingOperatorException,
87-
87: exceptions.QueryIncompleteException,
88-
88: exceptions.QueryEventCountQueryException,
89-
89: exceptions.QueryInvalidMetricException,
90-
90: exceptions.QueryIntegerException,
91-
91: exceptions.QueryColumnLimitException,
92-
92: exceptions.QueryLevelLimitException,
93-
93: exceptions.QueryBadAggsFormationException,
94-
94: exceptions.QueryInvalidAggFilterException,
95-
95: exceptions.QueryMetricsLevelException,
96-
96: exceptions.QueryTimeSeriesException,
97-
97: exceptions.QueryMetricsTypeException,
98-
98: exceptions.QueryContainsNumericException,
99-
99: exceptions.QueryExistsEntityLimitException,
100-
100: exceptions.QueryMultipleFiltersException,
101-
102: exceptions.QueryMissingNameParamException,
102-
103: exceptions.QuerySavedAlreadyExistsException,
103-
104: exceptions.QuerySavedNotExistsException,
104-
105: exceptions.QuerySavedInvalidTypeException,
105-
106: exceptions.MethodNotAllowedException,
106-
107: exceptions.QueryExistsMissingIdsException,
107-
108: exceptions.QueryInvalidFormatException,
108-
109: exceptions.QueryTopValuesParameterEmptyException,
109-
110: exceptions.QueryDataExtractionLimitValueException,
110-
111: exceptions.QueryDataExtractionLimitValueTooBigException,
111-
112: exceptions.QueryDataExtractionLimitAndPageTokenValueException,
112-
113: exceptions.QueryDataExtractionPageTokenValueException,
113-
114: exceptions.QueryDataExtractionColumnLimitException,
114-
115: exceptions.QueryExistsEntityEmptyException,
115-
116: exceptions.QuerySavedInvalidQueryValueException,
116-
117: exceptions.QuerySavedInvalidCachePeriodValueException,
117-
118: exceptions.QuerySavedInvalidNameException,
118-
119: exceptions.QueryCountInvalidParameterException,
119-
120: exceptions.QueryAggregationInvalidParameterException,
120-
121: exceptions.QueryAggregationInvalidFilterQueryException,
121-
122: exceptions.QueryInvalidMinfreqException,
122-
123: exceptions.QueryExceededMaxNumberQuerysException,
123-
124: exceptions.QueryInvalidOperatorUsageException,
124-
125: exceptions.QueryInvalidParameterUsageException,
125-
126: exceptions.QueryParameterInvalidColumnUsageException,
126-
127: exceptions.QueryInvalidColumnUsageException,
127-
# Internal errors (110 - 120)
128-
130: exceptions.InternalException,
129-
131: exceptions.ColumnCreateInternalException
10+
2: exceptions.DemoUnavailableException,
11+
1502: exceptions.RequestRateLimitException,
12+
1507: exceptions.RequestBodySizeExceededException,
13+
2012: exceptions.IndexEntitiesLimitException,
14+
2013: exceptions.IndexColumnsLimitException,
13015
}
13116

13217
slicer_exceptions = defaultdict(

0 commit comments

Comments
 (0)