MCPcopy
hub / github.com/dropbox/godropbox / makeTestErrorClassifier

Function makeTestErrorClassifier

errors/errors_test.go:91–110  ·  view source on GitHub ↗
(
	callCount *int,
)

Source from the content-addressed store, hash-verified

89}
90
91func makeTestErrorClassifier(
92 callCount *int,
93) func(curErr, topErr error) error {
94 return func(curErr, topErr error) error {
95 if callCount != nil {
96 *callCount++
97 }
98 dbxErr, ok := curErr.(DropboxError)
99 if !ok || dbxErr == nil {
100 return nil
101 }
102 str := dbxErr.GetMessage()
103 if str == "return_me" {
104 return curErr
105 } else if str == "return_top" {
106 return topErr
107 }
108 return nil
109 }
110}
111
112func TestFindWrappedErrorNils(t *testing.T) {
113 var err0 error

Callers 4

TestFindWrappedErrorNilsFunction · 0.85

Calls 1

GetMessageMethod · 0.65

Tested by

no test coverage detected