-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Added InputUriError and IPDistanceCalculationError #182
base: dev
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces three new exception classes: InputUriError, IPDistanceCalculationError, and TesUriError. These exceptions are added to the pro_tes/exceptions.py file and are also included in the exceptions dictionary. Class diagram showing new exception hierarchyclassDiagram
ValueError <|-- TesUriError
ValueError <|-- InputUriError
ValueError <|-- IPDistanceCalculationError
ValueError <|-- MiddlewareException
MiddlewareException <|-- InvalidMiddleware
class TesUriError {
+str message
+str code
}
note for TesUriError "New: Raised when TES URI cannot be parsed"
class InputUriError {
+str message
+str code
}
note for InputUriError "New: Raised when input URI cannot be parsed"
class IPDistanceCalculationError {
+str message
}
note for IPDistanceCalculationError "New: Raised when IP distance cannot be calculated"
class MiddlewareException {
+str message
+str code
}
class InvalidMiddleware {
+str message
+str code
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Nidhi091999 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please fill out the PR description with details about the motivation for these new exceptions and reference any related issues.
- The exceptions dictionary entries should maintain consistency - TesUriError and IPDistanceCalculationError are missing HTTP status codes while other entries have them.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -94,4 +102,14 @@ class InvalidMiddleware(MiddlewareException): | |||
"message": "Middleware is invalid.", | |||
"code": "500", | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Missing error code for TesUriError and IPDistanceCalculationError exceptions
Other exceptions in the dictionary include both 'message' and 'code' fields. Consider adding appropriate error codes to maintain consistency in error handling.
Issue: #168
Summary by Sourcery
Add
InputUriError
andIPDistanceCalculationError
exceptions, and add aTesUriError
exception.New Features:
InputUriError
for signaling invalid input URIs.IPDistanceCalculationError
for when IP distance calculation fails.TesUriError
for when a TES URI cannot be parsed.