mirror of
https://github.com/outbackdingo/certificates.git
synced 2026-01-27 10:18:34 +00:00
Fix linter warning about bad error name
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user