-
Notifications
You must be signed in to change notification settings - Fork 103
Clear error message from Check-In API #810
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
base: development
Are you sure you want to change the base?
Conversation
Reviewer's GuideReplace hard-coded error placeholders in the Check-In API _redeem_process response with dynamic error codes and messages derived from the exception. Sequence diagram for updated error handling in Check-In APIsequenceDiagram
participant Client
participant API as Check-In API (_redeem_process)
participant Exception as Exception (e)
Client->>API: Redeem check-in request
API->>Exception: Error occurs (raises e)
API-->>Client: Response { status: 'error', reason: e.code, message: str(e.msg) }
Class diagram for updated Check-In API error responseclassDiagram
class _redeem_process {
+Response()
-reason_explanation: str // changed from 'unknown' to str(e.msg)
-reason: str // changed from 'Already checked in' to e.code
-message: str // new, set to str(e.msg)
}
File-Level Changes
Possibly linked issues
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 @yaxit24 - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- There is an unintended space in 'e. code' which may cause a NameError. (link)
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/pretix/api/views/checkin.py:703` </location>
<code_context>
- 'status': 'redeemed',
- 'reason': 'Already checked in',
+ 'status': 'error'
+ 'reason': e. code,
+ 'message': str(e.msg),
'require_attention': op.require_checkin_attention,
</code_context>
<issue_to_address>
There is an unintended space in 'e. code' which may cause a NameError.
Remove the space so it reads 'e.code' to prevent a NameError at runtime.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Screen.Recording.2025-07-29.at.1.48.15.AM.mov |
Could you add a screenshot from the |
Fixes : #809
Summary by Sourcery
Improve error feedback in the Check-In API by surfacing the specific exception message and code in the response.
Bug Fixes: