Skip to content

Commit b2e8111

Browse files
committed
Allow recrusive generic error
Error sent from child process is already genericError, if we don't allow recrusive generic error, we won't get any cause infomation from parent process. Before, we got: WARN[0000] exit status 1 ERRO[0000] operation not permitted After, we got: WARN[0000] exit status 1 ERRO[0000] container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"operation not permitted\"" it's not pretty but useful for detecting root causes. Signed-off-by: Qiang Huang <[email protected]>
1 parent f516b5d commit b2e8111

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

libcontainer/generic_error.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ func newSystemErrorWithCause(err error, cause string) Error {
6767
// stack frames skipped. This is only to be called by the other functions for
6868
// formatting the error.
6969
func createSystemError(err error, cause string) Error {
70-
if le, ok := err.(Error); ok {
71-
return le
72-
}
7370
gerr := &genericError{
7471
Timestamp: time.Now(),
7572
Err: err,

libcontainer/process_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ loop:
356356
}
357357
}
358358
if !sentRun {
359-
return newSystemErrorWithCause(ierr, "container init failed")
359+
return newSystemErrorWithCause(ierr, "container init")
360360
}
361361
if p.config.Config.Namespaces.Contains(configs.NEWNS) && !sentResume {
362362
return newSystemError(fmt.Errorf("could not synchronise after executing prestart hooks with container process"))

0 commit comments

Comments
 (0)