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(router): change Not Found response to Internal Server Error for empty vector #6150

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Sep 27, 2024

  1. [FIX] Change Not Found Response to Internal Server Error for Empty Ve…

    …ctor (juspay#5916)
    
    Modified the get_aggregates_for_payments function to address issue juspay#5916. 
    
    - Replaced the to_not_found_response handler with map_err to handle internal errors during data fetching.
    - Ensured that an empty vector returned from the get_intent_status_with_count method is treated as valid and does not result in a "Not Found" error.
    - Now, an Internal Server Error (HTTP 500) is returned only when there is an actual problem with fetching data from the database.
    - Attached a descriptive error message using attach_printable to provide more context in case of internal errors.
    
    This fix ensures that valid empty results no longer cause false error responses and internal issues are correctly flagged with a 500 error.
    shreyshukla29 authored Sep 27, 2024
    Configuration menu
    Copy the full SHA
    a4b11bd View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. Configuration menu
    Copy the full SHA
    de768d3 View commit details
    Browse the repository at this point in the history
  2. fix(router): change error handling to Internal Server Error for empty…

    … vector Updated the get_aggregates_for_payments function to use change_context to return an Internal Server Error (500) when there's a failure fetching payment intent status. Added a human-readable message for better debugging. Fixes juspay#5916
    shreyshukla29 authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    97d8b8b View commit details
    Browse the repository at this point in the history