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

Commit41145a6

Browse files
authored
fix: improve error handling when posting workspace agent version (#5775)
A customer ran into an unfortunate error here that we miss!
1 parent6b68fbb commit41145a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎codersdk/workspaceagents.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,15 +489,15 @@ func (c *Client) PostWorkspaceAgentAppHealth(ctx context.Context, req PostWorksp
489489
}
490490

491491
func (c*Client)PostWorkspaceAgentVersion(ctx context.Context,versionstring)error {
492-
// Phone home and tell the mothership what version we're on.
493492
versionReq:=PostWorkspaceAgentVersionRequest{Version:version}
494493
res,err:=c.Request(ctx,http.MethodPost,"/api/v2/workspaceagents/me/version",versionReq)
495494
iferr!=nil {
495+
returnerr
496+
}
497+
deferres.Body.Close()
498+
ifres.StatusCode!=http.StatusOK {
496499
returnreadBodyAsError(res)
497500
}
498-
// Discord the response
499-
_,_=io.Copy(io.Discard,res.Body)
500-
_=res.Body.Close()
501501
returnnil
502502
}
503503

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp