11
11
from mock_vws ._mock_common import json_dump
12
12
13
13
14
- class ValidatorException (Exception ):
14
+ class ValidatorError (Exception ):
15
15
"""
16
16
A base class for exceptions thrown from mock Vuforia cloud recognition
17
17
client endpoints.
@@ -22,7 +22,7 @@ class ValidatorException(Exception):
22
22
headers : dict [str , str ]
23
23
24
24
25
- class DateHeaderNotGiven (ValidatorException ):
25
+ class DateHeaderNotGiven (ValidatorError ):
26
26
"""
27
27
Exception raised when a date header is not given.
28
28
"""
@@ -48,7 +48,7 @@ def __init__(self) -> None:
48
48
}
49
49
50
50
51
- class DateFormatNotValid (ValidatorException ):
51
+ class DateFormatNotValid (ValidatorError ):
52
52
"""
53
53
Exception raised when the date format is not valid.
54
54
"""
@@ -75,7 +75,7 @@ def __init__(self) -> None:
75
75
}
76
76
77
77
78
- class RequestTimeTooSkewed (ValidatorException ):
78
+ class RequestTimeTooSkewed (ValidatorError ):
79
79
"""
80
80
Exception raised when Vuforia returns a response with a result code
81
81
'RequestTimeTooSkewed'.
@@ -106,7 +106,7 @@ def __init__(self) -> None:
106
106
}
107
107
108
108
109
- class BadImage (ValidatorException ):
109
+ class BadImage (ValidatorError ):
110
110
"""
111
111
Exception raised when Vuforia returns a response with a result code
112
112
'BadImage'.
@@ -144,7 +144,7 @@ def __init__(self) -> None:
144
144
}
145
145
146
146
147
- class AuthenticationFailure (ValidatorException ):
147
+ class AuthenticationFailure (ValidatorError ):
148
148
"""
149
149
Exception raised when Vuforia returns a response with a result code
150
150
'AuthenticationFailure'.
@@ -182,7 +182,7 @@ def __init__(self) -> None:
182
182
}
183
183
184
184
185
- class AuthenticationFailureGoodFormatting (ValidatorException ):
185
+ class AuthenticationFailureGoodFormatting (ValidatorError ):
186
186
"""
187
187
Exception raised when Vuforia returns a response with a result code
188
188
'AuthenticationFailure' with a standard JSON formatting.
@@ -215,7 +215,7 @@ def __init__(self) -> None:
215
215
}
216
216
217
217
218
- class ImageNotGiven (ValidatorException ):
218
+ class ImageNotGiven (ValidatorError ):
219
219
"""
220
220
Exception raised when an image is not given.
221
221
"""
@@ -242,7 +242,7 @@ def __init__(self) -> None:
242
242
}
243
243
244
244
245
- class AuthHeaderMissing (ValidatorException ):
245
+ class AuthHeaderMissing (ValidatorError ):
246
246
"""
247
247
Exception raised when an auth header is not given.
248
248
"""
@@ -270,7 +270,7 @@ def __init__(self) -> None:
270
270
}
271
271
272
272
273
- class MalformedAuthHeader (ValidatorException ):
273
+ class MalformedAuthHeader (ValidatorError ):
274
274
"""
275
275
Exception raised when an auth header is not given.
276
276
"""
@@ -299,7 +299,7 @@ def __init__(self) -> None:
299
299
}
300
300
301
301
302
- class UnknownParameters (ValidatorException ):
302
+ class UnknownParameters (ValidatorError ):
303
303
"""
304
304
Exception raised when unknown parameters are given.
305
305
"""
@@ -326,7 +326,7 @@ def __init__(self) -> None:
326
326
}
327
327
328
328
329
- class InactiveProject (ValidatorException ):
329
+ class InactiveProject (ValidatorError ):
330
330
"""
331
331
Exception raised when Vuforia returns a response with a result code
332
332
'InactiveProject'.
@@ -363,7 +363,7 @@ def __init__(self) -> None:
363
363
}
364
364
365
365
366
- class InvalidMaxNumResults (ValidatorException ):
366
+ class InvalidMaxNumResults (ValidatorError ):
367
367
"""
368
368
Exception raised when an invalid value is given as the
369
369
"max_num_results" field.
@@ -395,7 +395,7 @@ def __init__(self, given_value: str) -> None:
395
395
}
396
396
397
397
398
- class MaxNumResultsOutOfRange (ValidatorException ):
398
+ class MaxNumResultsOutOfRange (ValidatorError ):
399
399
"""
400
400
Exception raised when an integer value is given as the "max_num_results"
401
401
field which is out of range.
@@ -427,7 +427,7 @@ def __init__(self, given_value: str) -> None:
427
427
}
428
428
429
429
430
- class InvalidIncludeTargetData (ValidatorException ):
430
+ class InvalidIncludeTargetData (ValidatorError ):
431
431
"""
432
432
Exception raised when an invalid value is given as the
433
433
"include_target_data" field.
@@ -461,7 +461,7 @@ def __init__(self, given_value: str) -> None:
461
461
}
462
462
463
463
464
- class UnsupportedMediaType (ValidatorException ):
464
+ class UnsupportedMediaType (ValidatorError ):
465
465
"""
466
466
Exception raised when no boundary is found for multipart data.
467
467
"""
@@ -487,7 +487,7 @@ def __init__(self) -> None:
487
487
}
488
488
489
489
490
- class InvalidAcceptHeader (ValidatorException ):
490
+ class InvalidAcceptHeader (ValidatorError ):
491
491
"""
492
492
Exception raised when there is an invalid accept header given.
493
493
"""
@@ -513,7 +513,7 @@ def __init__(self) -> None:
513
513
}
514
514
515
515
516
- class NoBoundaryFound (ValidatorException ):
516
+ class NoBoundaryFound (ValidatorError ):
517
517
"""
518
518
Exception raised when an invalid media type is given.
519
519
"""
@@ -543,7 +543,7 @@ def __init__(self) -> None:
543
543
}
544
544
545
545
546
- class ContentLengthHeaderTooLarge (ValidatorException ):
546
+ class ContentLengthHeaderTooLarge (ValidatorError ):
547
547
"""
548
548
Exception raised when the given content length header is too large.
549
549
"""
@@ -566,7 +566,7 @@ def __init__(self) -> None: # pragma: no cover
566
566
}
567
567
568
568
569
- class ContentLengthHeaderNotInt (ValidatorException ):
569
+ class ContentLengthHeaderNotInt (ValidatorError ):
570
570
"""
571
571
Exception raised when the given content length header is not an integer.
572
572
"""
@@ -588,7 +588,7 @@ def __init__(self) -> None:
588
588
}
589
589
590
590
591
- class RequestEntityTooLarge (ValidatorException ):
591
+ class RequestEntityTooLarge (ValidatorError ):
592
592
"""
593
593
Exception raised when the given image file size is too large.
594
594
"""
@@ -627,7 +627,7 @@ def __init__(self) -> None: # pragma: no cover
627
627
}
628
628
629
629
630
- class NoContentType (ValidatorException ):
630
+ class NoContentType (ValidatorError ):
631
631
"""
632
632
Exception raised when a content type is either not given or is empty.
633
633
"""
0 commit comments