Skip to content

Commit

Permalink
Added InputUriError and IPDistanceCalculationError
Browse files Browse the repository at this point in the history
  • Loading branch information
Nidhi091999 committed Jan 20, 2025
1 parent 1331fea commit 085da42
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pro_tes/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ class NoTesInstancesAvailable(ValueError):
class MiddlewareException(ValueError):
"""Raised when a middleware could not be applied."""

class TesUriError(ValueError):
"""Raised when TES URI cannot be parsed."""

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

class InputUriError(ValueError):
"""Raised when input URI cannot be parsed."""


class IPDistanceCalculationError(ValueError):
"""Raised when IP distance cannot be calculated."""

exceptions = {
Exception: {
Expand Down Expand Up @@ -94,4 +102,14 @@ class InvalidMiddleware(MiddlewareException):
"message": "Middleware is invalid.",
"code": "500",
},
InputUriError: {
"message": "Input URI cannot be parsed.",
"code": "400",
},
IPDistanceCalculationError: {
"message": "IP distance calculation failed.",
},
TesUriError: {
"message": "TES URI cannot be parsed",
},
}

0 comments on commit 085da42

Please sign in to comment.