fix(GODT-3102): Distinguish Vault Decryption from Serialization Errors

Rather than returning whether the vault was corrupt or not return the
error which caused the vault to be considered as corrupt.
This commit is contained in:
Leander Beernaert
2023-11-30 08:31:14 +01:00
parent 7a1c7e8743
commit 1b22c32ef9
10 changed files with 50 additions and 37 deletions

View File

@ -112,8 +112,8 @@ func (t *testCtx) initBridge() (<-chan events.Event, error) {
vault, corrupt, err := vault.New(vaultDir, gluonCacheDir, t.storeKey, async.NoopPanicHandler{})
if err != nil {
return nil, fmt.Errorf("could not create vault: %w", err)
} else if corrupt {
return nil, fmt.Errorf("vault is corrupt")
} else if corrupt != nil {
return nil, fmt.Errorf("vault is corrupt: %w", corrupt)
}
t.vault = vault