Skip to content

Commit 65d202d

Browse files
authored
Merge pull request #574 from zigbee-alliance/fix/bug-fixes
Fix error message texts
2 parents ccac781 + de252c1 commit 65d202d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

types/pki/errors.go

+7
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ func NewErrCertificateDoesNotExist(subject string, subjectKeyID string) error {
9393
subject, subjectKeyID)
9494
}
9595

96+
func NewErrNocRootCertificateDoesNotExist(subject string, subjectKeyID string) error {
97+
return errors.Wrapf(ErrCertificateDoesNotExist,
98+
"No X509 NOC root certificate associated with the "+
99+
"combination of subject=%v and subjectKeyID=%v on the ledger",
100+
subject, subjectKeyID)
101+
}
102+
96103
func NewErrCertificateBySerialNumberDoesNotExist(subject string, subjectKeyID string, serialNumber string) error {
97104
return errors.Wrapf(ErrCertificateDoesNotExist,
98105
"No X509 certificate associated with the "+

x/pki/keeper/msg_server_remove_noc_x_509_root_cert.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (k msgServer) RemoveNocX509RootCert(goCtx context.Context, msg *types.MsgRe
3131
certificates := nocCerts.Certs
3232
certificates = append(certificates, revCerts.Certs...)
3333
if len(certificates) == 0 {
34-
return nil, pkitypes.NewErrCertificateDoesNotExist(msg.Subject, msg.SubjectKeyId)
34+
return nil, pkitypes.NewErrNocRootCertificateDoesNotExist(msg.Subject, msg.SubjectKeyId)
3535
}
3636

3737
cert := certificates[0]

x/pki/keeper/msg_server_revoke_noc_x_509_root_cert.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (k msgServer) RevokeNocX509RootCert(goCtx context.Context, msg *types.MsgRe
2525

2626
certificates, _ := k.GetApprovedCertificates(ctx, msg.Subject, msg.SubjectKeyId)
2727
if len(certificates.Certs) == 0 {
28-
return nil, pkitypes.NewErrCertificateDoesNotExist(msg.Subject, msg.SubjectKeyId)
28+
return nil, pkitypes.NewErrNocRootCertificateDoesNotExist(msg.Subject, msg.SubjectKeyId)
2929
}
3030

3131
cert := certificates.Certs[0]

0 commit comments

Comments
 (0)