This checks the types of errors returned while copying files
(err error)
| 317 | |
| 318 | // This checks the types of errors returned while copying files |
| 319 | func (s *syncCopyMove) processError(err error) { |
| 320 | if err == nil { |
| 321 | return |
| 322 | } |
| 323 | if err == context.DeadlineExceeded { |
| 324 | err = fserrors.NoRetryError(err) |
| 325 | } else if err == accounting.ErrorMaxTransferLimitReachedGraceful { |
| 326 | if s.inCtx.Err() == nil { |
| 327 | fs.Logf(nil, "%v - stopping transfers", err) |
| 328 | // Cancel the march and stop the pipes |
| 329 | s.inCancel() |
| 330 | } |
| 331 | } else if err == context.Canceled && s.inCtx.Err() != nil { |
| 332 | // Ignore context Canceled if we have called s.inCancel() |
| 333 | return |
| 334 | } |
| 335 | s.errorMu.Lock() |
| 336 | defer s.errorMu.Unlock() |
| 337 | switch { |
| 338 | case fserrors.IsFatalError(err): |
| 339 | if !s.aborting() { |
| 340 | fs.Errorf(nil, "Cancelling sync due to fatal error: %v", err) |
| 341 | s.cancel() |
| 342 | } |
| 343 | s.fatalErr = err |
| 344 | case fserrors.IsNoRetryError(err): |
| 345 | s.noRetryErr = err |
| 346 | default: |
| 347 | s.err = err |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | // Returns the current error (if any) in the order of precedence |
| 352 | // |
no test coverage detected