94 back end add exception handling and logging#100
Open
erfanul007 wants to merge 11 commits intomasterfrom
Open
94 back end add exception handling and logging#100erfanul007 wants to merge 11 commits intomasterfrom
erfanul007 wants to merge 11 commits intomasterfrom
Conversation
Collaborator
erfanul007
commented
Jun 17, 2023
- Added configuration of logging
- Updated all methods with try catch
- Server error logging added
smhimran
requested changes
Dec 10, 2024
…ging # Conflicts: # suggestion_app/services/generateSuggestion.py
smhimran
approved these changes
Feb 1, 2025
Owner
smhimran
left a comment
There was a problem hiding this comment.
Looks good to me. A few improvements can be made, some of them are not urgent and we can do sometime in the (not so soon ;p) future.
| ports: | ||
| - "80:80" | ||
| - "8080:80" | ||
| volumes: |
Owner
There was a problem hiding this comment.
Is this necessary? Nginx should run on docker port 80 without any errors.
| return Response({'message': 'User not found'} ,status=404) | ||
| except Exception as ex: | ||
| logger.exception(ex) | ||
| return Response(status=500, data={'message': 'Some error occurred while getting user score.'}) |
Owner
There was a problem hiding this comment.
Or, you can raise the exception without having to return a 500 error. However, that's optional.
|
|
||
| if response1.status_code != 200 or response1.json()['status'] != 'OK': | ||
| try: | ||
| response1 = requests.get("https://codeforces.com/api/user.rating?handle=" + cf_username) |
Owner
There was a problem hiding this comment.
We should move these API requests to a different service...as an improvement of course.
Owner
There was a problem hiding this comment.
@erfanul007 Add a todo and an issue to move this API call and other API calls to a service. We can close the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.