hyperswitch-card-vault
hyperswitch-card-vault copied to clipboard
[ENHANCEMENT] Improve the error propagation and define a standard structure to handle them
Description
Due to error-stack
its easy to simply change the context and propagate errors without much effort, but this definitely reduces the quality of the error propagation as there is no strict standard that the errors need to adhere to.
This issue addresses this discussing upon a more standardized way of handling error removing change_context
from the code based promoting a more declarative way of error handling instead of the current imperative way.
Possible Approaches
- Wrap the current error into a custom defined struct, create a specific context for all the layers/APIs and then define
TryFrom
implementation for them, internally handling the change contexts