[FIX] Change Not Found Response to Internal Server Error for Empty Vector #5916
Labels
A-payments
Area: payments
C-bug
Category: Bug
C-refactor
Category: Refactor
good first issue
Good for newcomers
S-awaiting-triage
Status: New issues that have not been assessed yet
Feature Description
In the get_aggregates_for_payments function, when querying the database using the get_intent_status_with_count method, the function currently returns a Not Found response when an empty vector is encountered.
The not found case will never arise since we will be getting empty vector in such cases.
Since this scenario represents an internal logic issue rather than a missing payment, we should update the function to return an Internal Server Error instead.
Possible Implementation
to_not_found_response
error handler with one that returns anInternal Server Error (500)
when an empty vector is encountered in intent_status_with_count.attach_printable
to attach a descriptive error message when an error occurs in fetching payment aggregates.Have you spent some time checking if this feature request has been raised before?
Have you read the Contributing Guidelines?
Are you willing to submit a PR?
None
The text was updated successfully, but these errors were encountered: