MCPcopy
hub / github.com/syncthing/syncthing / redactPathError

Function redactPathError

lib/model/model.go:3475–3484  ·  view source on GitHub ↗

redactPathError checks if the error is actually a os.PathError, and if yes returns a redactedError with the path removed.

(err error)

Source from the content-addressed store, hash-verified

3473// redactPathError checks if the error is actually a os.PathError, and if yes
3474// returns a redactedError with the path removed.
3475func redactPathError(err error) (error, bool) {
3476 var perr *os.PathError
3477 if !errors.As(err, &perr) {
3478 return nil, false
3479 }
3480 return &redactedError{
3481 error: err,
3482 redacted: fmt.Errorf("%v: %w", perr.Op, perr.Err),
3483 }, true
3484}
3485
3486type redactedError struct {
3487 error

Callers 1

ccCheckEncryptionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected