-
Notifications
You must be signed in to change notification settings - Fork 881
pkg/tar/chroot: avoid errwrap in function called by multicall #2997
pkg/tar/chroot: avoid errwrap in function called by multicall #2997
Conversation
|
We can see the error message now, this time on |
pkg/tar/chroot.go
Outdated
| } | ||
| if err := syscall.Chdir("/"); err != nil { | ||
| return errwrap.Wrap(errors.New("failed to chdir"), err) | ||
| return fmt.Errorf("failed to chdir: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double space
|
A nit. LGTM after that. |
When a function is called by multicall, it is not possible to use errwrap because the log pkg is not initialized yet. Also initialize the log pkg will not show the correct indentation in the log because the new process will start printing from the most left. Fixes rkt#2984
I wonder which file it is... |
391c730 to
dbc4e86
Compare
|
Patch updated. Also I enhanced the error message in case of |
pkg/tar/tar.go
Outdated
| err = extractFile(tr, target, hdr, overwrite, editor) | ||
| if err != nil { | ||
| return err | ||
| return fmt.Errorf("%s. extractFile failed on target: %s",err, target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target is the output directory, shouldn't we print $target/hdr.Name?
dbc4e86 to
1e7b1c3
Compare
pkg/tar/tar.go
Outdated
| err = extractFile(tr, target, hdr, overwrite, editor) | ||
| if err != nil { | ||
| return err | ||
| return fmt.Errorf("extractFile failed on %s/%s: %v", target, hdr.Name, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Errorf("could not extract file %q in %q: %v", hdr.Name, target, err)
Sometimes tests fail on `ExtractTarInsecure()` and the error message was not clear enough to reproduce the fail. In case of error from `extractFile()` or `UtimesNano()`, `ExtractTarInsecure()` adds the file name to the returned error.
1e7b1c3 to
3c21c4a
Compare
|
lgtm |
|
The failure on Semaphore does not seem related to this PR: "fetch: bad HTTP status code: 504" (TestFetch) |
|
LGTM |
When a function is called by multicall, it is not possible to use errwrap
because the log pkg is not initialized yet. Also initialize the log pkg will
not show the correct indentation in the log because the new process will
start printing from the most left.
Fixes #2984