You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_4 (already cloned)
- Base commit: 212ac27057762f9d4cd2073d93c2216f61711cfe
- Task ID: juspay__hyperswitch-7936
- Version: v1.114.0
TASK DESCRIPTION: Bug: [FIX]: Fix error message while using generic filter
Fix error message while using generic filter
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This PR changes the way we raise error if something goes wrong with generic filter. Currently we throw not found error which is wrong.
This feature is hard to test on hosted environments, as this requires to make some db changes so that we can get error in generic filter.
Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
We will able able to log correct error messages
How did you test it?
Tested it with dropping
organization_idcolumn in refund table while trying to create refund. According to current implementation, we are raising not found error which is incorrect because it is not displaying the right cause.Implementation in this PR fixes this bug.
Checklist
- I formatted the code
cargo +nightly fmt --all - I addressed lints thrown by
Assistant
I'll help you fix the error message issue with the generic filter in the hyperswitch repository. Let me first understand the problem by examining the relevant code.
Let me start by looking at the error message handling and generic filter implementation:
Assistant
Let me search for files related to generic filters and error handling in the codebase to understand the issue better:
Assistant
Let me check the current working directory and explore the repository structure:
Assistant
Now let me search for files related to generic filters and error handling in the crates directory:
Assistant
Let me search in the correct directory structure:
Assistant
Now let me look at the generics.rs file since that's likely where the generic filter implementation is:
Assistant
Now I need to look at the errors module to understand the database error types:
Assistant
Let me check some refund-related files to better understand the context:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.