MCPcopy
hub / github.com/syncthing/syncthing / errorToCode

Function errorToCode

lib/protocol/errors.go:30–41  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

28}
29
30func errorToCode(err error) ErrorCode {
31 switch {
32 case err == nil:
33 return ErrorCodeNoError
34 case errors.Is(err, ErrNoSuchFile):
35 return ErrorCodeNoSuchFile
36 case errors.Is(err, ErrInvalid):
37 return ErrorCodeInvalidFile
38 default:
39 return ErrorCodeGeneric
40 }
41}

Callers 1

handleRequestMethod · 0.85

Calls 1

IsMethod · 0.45

Tested by

no test coverage detected