Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

AishwaryJain07
Copy link

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.

@AishwaryJain07 AishwaryJain07 changed the title FIX#4259: Fixed AWS credential Error FIX#4259: Add better error handling for getting AWS credentials for a challenge Mar 21, 2024
@AishwaryJain07
Copy link
Author

closes #4259

@AishwaryJain07
Copy link
Author

@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}")
Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

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.

Copy link
Collaborator

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}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here @AishwaryJain07

Copy link
Member

@Suryansh5545 Suryansh5545 left a 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

@AishwaryJain07
Copy link
Author

Left some comments to be addressed

@Suryansh5545 the log only creates an entry for developers to understand.
like a debugging message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants