Similarly, both handlers return a string if an error happens. This is not ideal. Instead, an error object like SuccessOrErrorMessage can instead be returned, and the error string can be built by the client themselves. This is done to an extent by VaultsSecretsMkdir (see Additional context), but that approach is still incorrect, as VaultOps returns an error object instead of throwing an error. All VaultOps operations should throw an error, which should be handled and converted as necessary by the handler itself.
Specification
Similarly, both handlers return a string if an error happens. This is not ideal. Instead, an error object like
SuccessOrErrorMessage
can instead be returned, and the error string can be built by the client themselves. This is done to an extent byVaultsSecretsMkdir
(see Additional context), but that approach is still incorrect, as VaultOps returns an error object instead of throwing an error. AllVaultOps
operations should throw an error, which should be handled and converted as necessary by the handler itself.Additional context
Tasks