Export error field in ErrEventReceived

This will allow to reuse the error in other packages and compare
it in assert.Equal unit-tests and similar

Change-Id: Iccc6df713cedb78f6e75f7fba8d317bfcc6e8e84
This commit is contained in:
Kostiantyn Kalynovskyi 2020-08-15 14:20:55 -05:00
parent a8bdae6c9a
commit d37f13b6cb
2 changed files with 3 additions and 3 deletions

View File

@ -20,10 +20,10 @@ import (
// ErrEventReceived returned for not implemented features // ErrEventReceived returned for not implemented features
type ErrEventReceived struct { type ErrEventReceived struct {
errors []error Errors []error
} }
func (e ErrEventReceived) Error() string { func (e ErrEventReceived) Error() string {
// TODO make printing more readable here // TODO make printing more readable here
return fmt.Sprintf("Applying of resources to kubernetes cluster has failed, errors are:\n%v", e.errors) return fmt.Sprintf("Applying of resources to kubernetes cluster has failed, errors are:\n%v", e.Errors)
} }

View File

@ -77,7 +77,7 @@ func (p *DefaultProcessor) processApplierEvent(e applyevent.Event) {
func checkErrors(errs []error) error { func checkErrors(errs []error) error {
if len(errs) != 0 { if len(errs) != 0 {
return ErrEventReceived{ return ErrEventReceived{
errors: errs, Errors: errs,
} }
} }
return nil return nil