Skip to content

Commit

Permalink
fixed error messages to give more context (#1196)
Browse files Browse the repository at this point in the history
* fixed error messages to give more context

* updated CHANGELOG.md
  • Loading branch information
fdymylja authored Apr 2, 2020
1 parent b9b8862 commit 32739e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## HEAD
- `bnsd`: updated error messages to better reflect the account module spec
- `bnsd`: account targets are cleared when an account is transferred
- `bnsd`: domain renew expiration time equals to domain expiration time + configuration domain renew duration, if this time is before current block time then renew time becomes current block time + configuration domain renew duration
- `bnsd`: revert burn feature
Expand Down
4 changes: 2 additions & 2 deletions cmd/bnsd/x/account/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ func (h *deleteAccountHandler) validate(ctx weave.Context, db weave.KVStore, tx
authenticated = h.auth.HasAddress(ctx, domain.Admin)
}
if !authenticated {
return nil, errors.Wrap(errors.ErrUnauthorized, "only owner can delete an account")
return nil, errors.Wrap(errors.ErrUnauthorized, "only account owner or domain owner (if domain has a superuser) can delete an account")
}
return &msg, nil
}
Expand Down Expand Up @@ -851,7 +851,7 @@ func (h *addAccountCertificateHandler) validate(ctx weave.Context, db weave.KVSt

var account Account
if err := h.accounts.One(db, accountKey(msg.Name, msg.Domain), &account); err != nil {
return nil, nil, errors.Wrap(err, "account")
return nil, nil, errors.Wrapf(err, "account %s does not exist", msg.Name)
}
if weave.IsExpired(ctx, account.ValidUntil) {
return nil, nil, errors.Wrap(errors.ErrExpired, "account")
Expand Down

0 comments on commit 32739e9

Please sign in to comment.