Skip to content

Commit

Permalink
[FABG-815] make multi-errors on a single line
Browse files Browse the repository at this point in the history
Change-Id: Id555345252e244e5f7f3f5fa0cea27f89d2b4103
Signed-off-by: Baha Shaaban <[email protected]>
  • Loading branch information
Baha Shaaban committed Jan 21, 2019
1 parent f50af62 commit 56ebf9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/client/channel/chclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func TestMultiErrorPropogation(t *testing.T) {
assert.True(t, ok, "Expected status error")
assert.EqualValues(t, status.MultipleErrors, status.ToSDKStatusCode(statusError.Code))
assert.Equal(t, status.ClientStatus, statusError.Group)
assert.Equal(t, "Multiple errors occurred: \nTest Error\nTest Error", statusError.Message, "Expected multi error message")
assert.Equal(t, "Multiple errors occurred: - Test Error - Test Error", statusError.Message, "Expected multi error message")
}

func TestDiscoveryGreylist(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/errors/multi/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ func (errs Errors) Error() string {
return errs[0].Error()
}

errors := []string{fmt.Sprint("Multiple errors occurred: ")}
errors := []string{fmt.Sprint("Multiple errors occurred:")}
for _, err := range errs {
errors = append(errors, err.Error())
}
return strings.Join(errors, "\n")
return strings.Join(errors, " - ")
}
2 changes: 1 addition & 1 deletion pkg/common/errors/multi/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestErrorString(t *testing.T) {
assert.Equal(t, testErr.Error(), errs.Error())

errs = append(errs, testErr)
assert.Equal(t, "Multiple errors occurred: \ntest\ntest", errs.Error())
assert.Equal(t, "Multiple errors occurred: - test - test", errs.Error())
}

func TestAppend(t *testing.T) {
Expand Down

0 comments on commit 56ebf9a

Please sign in to comment.