History

Make sure to log unhandled errors always (#6784)

In many situations, while testing we encounter ErrInternalError, to reduce logging we have removed logging from quite a few places which is acceptable but when ErrInternalError occurs we should have a facility to log the corresponding error, this helps to debug Minio server.

Harshavardhana committed 8 years ago

Commit a55a2981 parent 2929c1818 files · +228 −225Browse files

Showing the changes to cmd/api-errors_test.go (1 of 18 files). Show all

Unified · Split

cmd/api-errors_test.go+3−1
@@ -17,6 +17,7 @@ · 16 unmodified lines
17package cmd17package cmd
18 18
19import (19import (
20 "context"
20 "errors"21 "errors"
21 "testing"22 "testing"
22 23
@@ -64,8 +65,9 @@ var toAPIErrorCodeTests = []struct { · 41 unmodified lines
64}65}
65 66
66func TestAPIErrCode(t *testing.T) {67func TestAPIErrCode(t *testing.T) {
68 ctx := context.Background()
67 for i, testCase := range toAPIErrorCodeTests {69 for i, testCase := range toAPIErrorCodeTests {
68 errCode := toAPIErrorCode(testCase.err)70 errCode := toAPIErrorCode(ctx, testCase.err)
69 if errCode != testCase.errCode {71 if errCode != testCase.errCode {
70 t.Errorf("Test %d: Expected error code %d, got %d", i+1, testCase.errCode, errCode)72 t.Errorf("Test %d: Expected error code %d, got %d", i+1, testCase.errCode, errCode)
71 }73 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t