Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2f7219

Browse files
authored
feat(board): return adb stdout/err in case of error (#40)
* feat(board): return adb stdout/err in case of error* trigger ci
1 parentda80048 commita2f7219

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎pkg/board/remote/adb/adb.go‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ func (a *ADBConnection) Forward(ctx context.Context, localPort int, remotePort i
8282
iferr!=nil {
8383
returnerr
8484
}
85-
iferr:=cmd.RunWithinContext(ctx);err!=nil {
85+
ifout,err:=cmd.RunAndCaptureCombinedOutput(ctx);err!=nil {
8686
returnfmt.Errorf(
87-
"failed to forward ADB port %s to %s: %w",
87+
"failed to forward ADB port %s to %s: %w: %s",
8888
local,
8989
remote,
9090
err,
91+
out,
9192
)
9293
}
9394

@@ -99,8 +100,8 @@ func (a *ADBConnection) ForwardKillAll(ctx context.Context) error {
99100
iferr!=nil {
100101
returnerr
101102
}
102-
iferr:=cmd.RunWithinContext(ctx);err!=nil {
103-
returnfmt.Errorf("failed to kill all ADB forwarded ports: %w",err)
103+
ifout,err:=cmd.RunAndCaptureCombinedOutput(ctx);err!=nil {
104+
returnfmt.Errorf("failed to kill all ADB forwarded ports: %w: %s",err,out)
104105
}
105106
returnnil
106107
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp