@@ -18,6 +18,7 @@ package debug
18
18
import (
19
19
"context"
20
20
"fmt"
21
+ "github.com/pkg/errors"
21
22
"io"
22
23
"os"
23
24
"path/filepath"
@@ -47,19 +48,18 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out
47
48
pm := commands .GetPackageManager (req .GetInstance ().GetId ())
48
49
commandLine , err := getCommandLine (req , pm )
49
50
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" )
51
52
}
52
53
53
54
// Run Tool
54
55
cmd , err := executils .Command (commandLine )
55
56
if err != nil {
56
- return nil , fmt . Errorf ( "cannot execute debug tool: %s" , err )
57
+ return nil , errors . Wrap ( err , "Cannot execute debug tool" )
57
58
}
58
59
59
60
// Get stdIn pipe from tool
60
61
in , err := cmd .StdinPipe ()
61
62
if err != nil {
62
- fmt .Printf ("%v\n " , err )
63
63
return & dbg.DebugResp {Error : err .Error ()}, nil
64
64
}
65
65
defer in .Close ()
@@ -70,7 +70,6 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out
70
70
71
71
// Start the debug command
72
72
if err := cmd .Start (); err != nil {
73
- fmt .Printf ("%v\n " , err )
74
73
return & dbg.DebugResp {Error : err .Error ()}, nil
75
74
}
76
75
0 commit comments