Skip to content

Commit b6c2e6d

Browse files
committed
Added InputUriError and IPDistanceCalculationError
1 parent 1331fea commit b6c2e6d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pro_tes/exceptions.py

+20
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ class NoTesInstancesAvailable(ValueError):
3232
class MiddlewareException(ValueError):
3333
"""Raised when a middleware could not be applied."""
3434

35+
class TesUriError(ValueError):
36+
"""Raised when TES URI cannot be parsed."""
3537

3638
class InvalidMiddleware(MiddlewareException):
3739
"""Raised when a middleware is invalid."""
3840

41+
class InputUriError(ValueError):
42+
"""Raised when input URI cannot be parsed."""
43+
44+
45+
class IPDistanceCalculationError(ValueError):
46+
"""Raised when IP distance cannot be calculated."""
3947

4048
exceptions = {
4149
Exception: {
@@ -94,4 +102,16 @@ class InvalidMiddleware(MiddlewareException):
94102
"message": "Middleware is invalid.",
95103
"code": "500",
96104
},
105+
InputUriError: {
106+
"message": "Input URI cannot be parsed.",
107+
"code": "400",
108+
},
109+
IPDistanceCalculationError: {
110+
"message": "IP distance calculation failed.",
111+
"code": "500",
112+
},
113+
TesUriError: {
114+
"message": "TES URI cannot be parsed",
115+
"code": "400",
116+
},
97117
}

0 commit comments

Comments
 (0)