forked from TrueCloudLab/certificates
Fix linter warning about bad error name
This commit is contained in:
parent
1e0ea6f958
commit
18a648cffa
3 changed files with 7 additions and 7 deletions
|
@ -59,14 +59,14 @@ func (t Type) String() string {
|
|||
return strings.ToLower(string(t))
|
||||
}
|
||||
|
||||
// ErrNotImplemented is the type of error returned if an operation is not implemented.
|
||||
type ErrNotImplemented struct { //nolint:errname // ignore error name warning
|
||||
// NotImplementedError is the type of error returned if an operation is not implemented.
|
||||
type NotImplementedError struct { //nolint:errname // ignore error name warning
|
||||
|
||||
Message string
|
||||
}
|
||||
|
||||
// ErrNotImplemented implements the error interface.
|
||||
func (e ErrNotImplemented) Error() string {
|
||||
// NotImplementedError implements the error interface.
|
||||
func (e NotImplementedError) Error() string {
|
||||
if e.Message != "" {
|
||||
return e.Message
|
||||
}
|
||||
|
@ -75,6 +75,6 @@ func (e ErrNotImplemented) Error() string {
|
|||
|
||||
// StatusCode implements the StatusCoder interface and returns the HTTP 501
|
||||
// error.
|
||||
func (e ErrNotImplemented) StatusCode() int {
|
||||
func (e NotImplementedError) StatusCode() int {
|
||||
return http.StatusNotImplemented
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1
|
|||
// RenewCertificate will always return a non-implemented error as mTLS renewals
|
||||
// are not supported yet.
|
||||
func (s *StepCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) {
|
||||
return nil, apiv1.ErrNotImplemented{Message: "stepCAS does not support mTLS renewals"}
|
||||
return nil, apiv1.NotImplementedError{Message: "stepCAS does not support mTLS renewals"}
|
||||
}
|
||||
|
||||
// RevokeCertificate revokes a certificate.
|
||||
|
|
|
@ -162,7 +162,7 @@ func (v *VaultCAS) GetCertificateAuthority(req *apiv1.GetCertificateAuthorityReq
|
|||
// RenewCertificate will always return a non-implemented error as renewals
|
||||
// are not supported yet.
|
||||
func (v *VaultCAS) RenewCertificate(req *apiv1.RenewCertificateRequest) (*apiv1.RenewCertificateResponse, error) {
|
||||
return nil, apiv1.ErrNotImplemented{Message: "vaultCAS does not support renewals"}
|
||||
return nil, apiv1.NotImplementedError{Message: "vaultCAS does not support renewals"}
|
||||
}
|
||||
|
||||
// RevokeCertificate revokes a certificate by serial number.
|
||||
|
|
Loading…
Reference in a new issue