Skip to content

Commit

Permalink
Changed multi error to print all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinapathak committed Apr 15, 2019
1 parent cf05272 commit a1306ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bascule/error.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package bascule

import "fmt"

// Error is an optional interface to be implemented by security related errors
type Error interface {
Cause() error
Expand All @@ -13,7 +15,11 @@ type MultiError interface {
type Errors []error

func (e Errors) Error() string {
return "multiple errors"
var errors string
for _, err := range e {
errors = errors + ", " + err.Error()
}
return fmt.Sprintf("multiple errors: [%v]", errors)
}

func (e Errors) Errors() []error {
Expand Down

0 comments on commit a1306ac

Please sign in to comment.