Skip to content

Return 400 for botocore client errors#479

Merged
yunfeng-scale merged 2 commits intomainfrom
yunfneg-256kb
Apr 1, 2024
Merged

Return 400 for botocore client errors#479
yunfeng-scale merged 2 commits intomainfrom
yunfneg-256kb

Conversation

@yunfeng-scale
Copy link
Copy Markdown
Contributor

@yunfeng-scale yunfeng-scale commented Mar 30, 2024

Pull Request Summary

Return 400 for some client errors

Test Plan and Usage Guide

tested calling an endpoint with long message and received:
<Response [400]>

{"detail":"Invalid request: Error sending celery task: An error occurred (InvalidParameterValue) when calling the SendMessage operation: One or more parameters are invalid. Reason: Message must be shorter than 262144 bytes."}

@yunfeng-scale yunfeng-scale requested a review from a team March 30, 2024 01:25
kwargs=kwargs,
queue=queue_name,
)
except botocore.exceptions.ClientError as e:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a more specific error we can catch so we don't inadvertently classify internal bugs as 400s?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes i can check the error message whether it's about message size. but for now i want to make it simple and count every boto client error as user errors :) we can revisit it later when users complain.

@yunfeng-scale yunfeng-scale merged commit 5524f80 into main Apr 1, 2024
@yunfeng-scale yunfeng-scale deleted the yunfneg-256kb branch April 1, 2024 16:57
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.

2 participants