[CRIU] [PATCH 06/10] phaul: print a message from error objects

Andrei Vagin avagin at openvz.org
Wed Oct 18 02:59:17 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

It can help to understand a error.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 phaul/src/test/main.go | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/phaul/src/test/main.go b/phaul/src/test/main.go
index 9f5282d4e..9fe7950e5 100644
--- a/phaul/src/test/main.go
+++ b/phaul/src/test/main.go
@@ -146,13 +146,13 @@ func main() {
 	pid, _ := strconv.Atoi(os.Args[1])
 	fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_STREAM, 0)
 	if err != nil {
-		fmt.Printf("Can't make socketpair\n")
+		fmt.Printf("Can't make socketpair: %v\n", err)
 		return
 	}
 
 	err = prepareImages()
 	if err != nil {
-		fmt.Printf("Can't prepare dirs for images\n")
+		fmt.Printf("Can't prepare dirs for images: %v\n", err)
 		return
 	}
 
@@ -180,8 +180,7 @@ func main() {
 	fmt.Printf("Migrate\n")
 	err = cln.Migrate()
 	if err != nil {
-		fmt.Printf("Failed: ")
-		fmt.Print(err)
+		fmt.Printf("Failed: %v\n", err)
 		return
 	}
 
-- 
2.13.3



More information about the CRIU mailing list