In the Backend.Vault.Kv module, we're constructing OtherError with user-facing error messages as strings. We should follow the same pattern we're using everywhere else and construct a proper ADT + a Buildable instance.
CofferError is meant to be backend-agnostic, but it assumes that all backends will (possibly) throw a ServantError. However, this assumption is not true - the pass backend, for example, does not use servant.
The proposed solution is to refactor the CofferError such that it can wrap any backend-specific error:
data CofferError where
...
BackendError :: Buildable err => err -> CofferError
And then create backend-specific error types, with proper constructors,and move the ServantError constructor:
Clarification and motivation
As of #60, we're using the following definition for
CofferError
:There are 2 issues here:
Backend.Vault.Kv
module, we're constructingOtherError
with user-facing error messages as strings. We should follow the same pattern we're using everywhere else and construct a proper ADT + aBuildable
instance.CofferError
is meant to be backend-agnostic, but it assumes that all backends will (possibly) throw aServantError
. However, this assumption is not true - thepass
backend, for example, does not use servant.The proposed solution is to refactor the
CofferError
such that it can wrap any backend-specific error:And then create backend-specific error types, with proper constructors,and move the
ServantError
constructor:Acceptance criteria
CofferError
is backend-agnostic, and the haddocks make this explicit.VaulError
)