MCPcopy
hub / github.com/syncthing/syncthing / codeToError

Function codeToError

lib/protocol/errors.go:17–28  ·  view source on GitHub ↗
(code ErrorCode)

Source from the content-addressed store, hash-verified

15)
16
17func codeToError(code ErrorCode) error {
18 switch code {
19 case ErrorCodeNoError:
20 return nil
21 case ErrorCodeNoSuchFile:
22 return ErrNoSuchFile
23 case ErrorCodeInvalidFile:
24 return ErrInvalid
25 default:
26 return ErrGeneric
27 }
28}
29
30func errorToCode(err error) ErrorCode {
31 switch {

Callers 1

handleResponseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected