@@ -18,6 +18,7 @@ package debug
1818import (
1919 "context"
2020 "fmt"
21+ "github.com/pkg/errors"
2122 "io"
2223 "os"
2324 "path/filepath"
@@ -47,19 +48,18 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out
4748 pm := commands .GetPackageManager (req .GetInstance ().GetId ())
4849 commandLine , err := getCommandLine (req , pm )
4950 if err != nil {
50- return nil , fmt . Errorf ( "cannot get command line for tool: %s" , err )
51+ return nil , errors . Wrap ( err , "Cannot get command line for tool" )
5152 }
5253
5354 // Run Tool
5455 cmd , err := executils .Command (commandLine )
5556 if err != nil {
56- return nil , fmt . Errorf ( "cannot execute debug tool: %s" , err )
57+ return nil , errors . Wrap ( err , "Cannot execute debug tool" )
5758 }
5859
5960 // Get stdIn pipe from tool
6061 in , err := cmd .StdinPipe ()
6162 if err != nil {
62- fmt .Printf ("%v\n " , err )
6363 return & dbg.DebugResp {Error : err .Error ()}, nil
6464 }
6565 defer in .Close ()
@@ -70,7 +70,6 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out
7070
7171 // Start the debug command
7272 if err := cmd .Start (); err != nil {
73- fmt .Printf ("%v\n " , err )
7473 return & dbg.DebugResp {Error : err .Error ()}, nil
7574 }
7675
0 commit comments