-
Notifications
You must be signed in to change notification settings - Fork 809
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
FIX#4259: Add better error handling for getting AWS credentials for a challenge #4310
Conversation
closes #4259 |
@Suryansh5545 @gchhablani @RishabhJain2018 can you please review |
} | ||
return Response(response_data, status=status.HTTP_400_BAD_REQUEST) | ||
try: | ||
logging.debug(f"Retrieving challenge phase for ID: {phase_pk}") |
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.
Could you please provide an explanation for why this change was added?
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.
@Suryansh5545 it creates a log entry, developers can access for troubleshooting and understanding the code's behavior.
the idea of logging was mentioned by @gchhablani in his pr, "#4261".
this was all the behaviour i tried to add in the code, kindly let me know further any.
plus this also adds the try-catch block which already @gchhablani did.
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.
@AishwaryJain07 i think you misunderstood it. we want to give a error message to the user as return if something goes wrong instead of a generic message. you are going in the right direction by capturing the error and sending it back as a response. but the log thing isn't required for now.
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.
@AishwaryJain07 We do not want logging.
try: | ||
logging.debug(f"Retrieving challenge phase for ID: {phase_pk}") | ||
challenge_phase = get_challenge_phase_model(phase_pk) | ||
logging.debug(f"Challenge phase retrieved: {challenge_phase}") |
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.
Same here @AishwaryJain07
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.
Left some comments to be addressed
@Suryansh5545 the log only creates an entry for developers to understand. |
Here, I added Try-catch block to look for the errors, and also added the looging message to indicate the retrieval of challenge_phase id and passes a m,message after it retrieves of challenge_phase id.