juspay/hyperswitch

[FEATURE] Have `get_required_value` to use `ValidationError` in `OptionExt`

Open

#860 opened on Apr 12, 2023

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Rust (42,690 stars) (4,676 forks)batch import
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?

Are you willing to submit a PR?

No, but I'm happy to collaborate on a PR with someone else

Contributor guide

[FEATURE] Have `get_required_value` to use `ValidationError` in `OptionExt` · juspay/hyperswitch#860 | Good First Issue