hyperswitch-card-vault icon indicating copy to clipboard operation
hyperswitch-card-vault copied to clipboard

[ENHANCEMENT] Improve the error propagation and define a standard structure to handle them

Open NishantJoshi00 opened this issue 1 year ago • 0 comments

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

NishantJoshi00 avatar Nov 06 '23 13:11 NishantJoshi00