Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: client/archiver/directory.go

Issue 2535803004: isolate: give up and die on file unavailability (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/archiver/directory_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/archiver/directory.go
diff --git a/client/archiver/directory.go b/client/archiver/directory.go
index 961849fd63193c75a0febb609b58d95baf798f12..24c91afd19394b1bfafcb721bc9654b7b5f009c0 100644
--- a/client/archiver/directory.go
+++ b/client/archiver/directory.go
@@ -69,7 +69,7 @@ func walk(root string, blacklist []string, c chan<- *walkItem) {
err := filepath.Walk(root, func(p string, info os.FileInfo, err error) error {
total++
if err != nil {
- return fmt.Errorf("walk(%s): %s", p, err)
+ return fmt.Errorf("walk(%q): %v", p, err)
mithro 2016/11/29 03:43:44 This will cause the binary to fail if it tries to
djd-OOO-Apr2017 2016/11/29 03:51:55 Do you have a suggestion on how to check that? Als
}
if len(p) <= rootLen {
// Root directory.
@@ -98,7 +98,8 @@ func walk(root string, blacklist []string, c chan<- *walkItem) {
return nil
})
if err != nil {
- c <- &walkItem{err: err}
+ // No point continuing if an error occurred during walk.
+ log.Fatalf("Unable to walk %q: %v", root, err)
tandrii(chromium) 2016/11/30 14:35:08 1. a test for this would be nice anyway - panic ca
M-A Ruel 2016/11/30 15:39:14 I'm not enthusiastic about hard failing vs cleanly
}
}
« no previous file with comments | « no previous file | client/archiver/directory_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698