mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 16:25:21 -04:00
Use uber/multierr for error composition
This commit is contained in:
parent
a859accf1f
commit
f28e00659c
2 changed files with 4 additions and 40 deletions
|
@ -848,23 +848,3 @@ func (c *someCloser) Close() error {
|
|||
c.closed = true
|
||||
return c.closeErr
|
||||
}
|
||||
|
||||
func TestComposedErr(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
noErrs := []error{nil, nil, nil}
|
||||
assert.NoError(composeErr(noErrs))
|
||||
|
||||
someErrs := []error{
|
||||
errors.New("failed 4"),
|
||||
errors.New("failed 7"),
|
||||
nil,
|
||||
nil,
|
||||
errors.New("failed 9"),
|
||||
}
|
||||
err := composeErr(someErrs)
|
||||
assert.Error(err)
|
||||
assert.Contains(err.Error(), "4")
|
||||
assert.Contains(err.Error(), "7")
|
||||
assert.Contains(err.Error(), "9")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue