-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
The ResponseStatus enum is currently defined as a monolithic enum holding all possible values. While not entirely wrong, the usability of the type could be improved by re-arranging the variants into logical groups. This would also entail a refactoring of all types related to error management.
Proposed changes:
- a
Result<T>type would still be available, however the error type would not be aResponseStatusbut a newErrorStatustype; this is to prevent a logical error of having an error of typeSuccess - thus,
ResponseStatuswill be an enum with two variants:SuccessandError(ErrorStatus) ErrorStatuswill be further split intoService(ServiceError)(for internal service-related errors) andPsa(Error)(for errors related to the functionality of Parsec, generally returned from providers) - the error contained within the variant will be directly drawn from thepsa-cryptoRust crate