util: add doc comments for exported functions in errors.go

A number of exported functions in errors.go were missing doc comments.
Add them.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-06-16 09:40:46 -04:00 committed by mergify[bot]
parent 09e1c856d0
commit 75088aa36d

View File

@ -22,10 +22,12 @@ type ErrKeyNotFound struct {
err error err error
} }
// NewErrKeyNotFound returns a new ErrKeyNotFound error.
func NewErrKeyNotFound(keyName string, err error) ErrKeyNotFound { func NewErrKeyNotFound(keyName string, err error) ErrKeyNotFound {
return ErrKeyNotFound{keyName, err} return ErrKeyNotFound{keyName, err}
} }
// Error returns the error string for ErrKeyNotFound.
func (e ErrKeyNotFound) Error() string { func (e ErrKeyNotFound) Error() string {
return e.err.Error() return e.err.Error()
} }
@ -36,6 +38,7 @@ type ErrObjectExists struct {
err error err error
} }
// Error returns the error string for ErrObjectExists.
func (e ErrObjectExists) Error() string { func (e ErrObjectExists) Error() string {
return e.err.Error() return e.err.Error()
} }
@ -46,6 +49,7 @@ type ErrObjectNotFound struct {
err error err error
} }
// Error returns the error string for ErrObjectNotFound.
func (e ErrObjectNotFound) Error() string { func (e ErrObjectNotFound) Error() string {
return e.err.Error() return e.err.Error()
} }
@ -57,6 +61,7 @@ type ErrSnapNameConflict struct {
err error err error
} }
// Error returns the error string for ErrSnapNameConflict.
func (e ErrSnapNameConflict) Error() string { func (e ErrSnapNameConflict) Error() string {
return e.err.Error() return e.err.Error()
} }
@ -72,10 +77,12 @@ type ErrPoolNotFound struct {
Err error Err error
} }
// Error returns the error string for ErrPoolNotFound.
func (e ErrPoolNotFound) Error() string { func (e ErrPoolNotFound) Error() string {
return e.Err.Error() return e.Err.Error()
} }
// NewErrPoolNotFound returns a new ErrPoolNotFound error.
func NewErrPoolNotFound(pool string, err error) ErrPoolNotFound { func NewErrPoolNotFound(pool string, err error) ErrPoolNotFound {
return ErrPoolNotFound{pool, err} return ErrPoolNotFound{pool, err}
} }