Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 362ddc7

Browse files
author
Russtopia
committed
Enabled error response JSON body output
1 parent 11f797a commit 362ddc7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal/entclient/devurl.go

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func (c Client) DelDevURL(envID, urlID string) error {
2222
if err != nil {
2323
return err
2424
}
25+
defer res.Body.Close()
2526

2627
if res.StatusCode != http.StatusOK {
2728
return bodyError(res)
@@ -51,6 +52,7 @@ func (c Client) InsertDevURL(envID string, port int, name, access string) error
5152
if err != nil {
5253
return err
5354
}
55+
defer res.Body.Close()
5456

5557
if res.StatusCode != http.StatusOK {
5658
return bodyError(res)
@@ -80,6 +82,7 @@ func (c Client) UpdateDevURL(envID, urlID string, port int, name, access string)
8082
if err != nil {
8183
return err
8284
}
85+
defer res.Body.Close()
8386

8487
if res.StatusCode != http.StatusOK {
8588
return bodyError(res)

internal/entclient/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func bodyError(resp *http.Response) error {
11-
byt, err := httputil.DumpResponse(resp, false)
11+
byt, err := httputil.DumpResponse(resp, true)
1212
if err != nil {
1313
return xerrors.Errorf("dump response: %w", err)
1414
}

0 commit comments

Comments
 (0)