juspay/hyperswitch
View on GitHub[FEATURE] Have `get_required_value` to use `ValidationError` in `OptionExt`
Open
#860 opened on Apr 12, 2023
C-featureC-refactorE-mediumP-lowgood first issuehelp wanted
Description
Feature Description
Currently, the OptionExt::get_required_value is more API oriented as it returns ApiErrorResponse. But, throughout the codebase it is being used in varying context, and the overall error framework generates inconsistent hierarchical error report. By using ValidationError as a error type inside the trait, it will provide a very consistent error report, with in future can be automated by error casting.
Possible Implementation
This issue involves changing the OptionExt trait definition and implementation. This change isn't heavy in solutioning, but involves a significant amount of change in the overall codebase
Have you spent some time to check if this feature request has been raised before?
- I checked and didn't find similar issue
Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to submit a PR?
No, but I'm happy to collaborate on a PR with someone else