Skip to content

Commit 4eba719

Browse files
authored
DXE-3436 Merge pull request #198 from akamai/release/v7.6.0
Release/v7.6.0
2 parents 8f8b577 + 23b4afe commit 4eba719

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+11664
-128
lines changed

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# EDGEGRID GOLANG RELEASE NOTES
22

3+
## 7.6.0 (February 8, 2024)
4+
5+
#### FEATURES/ENHANCEMENTS:
6+
7+
* General
8+
* Enhanced error handling when Error is not in standard format.
9+
10+
* Added Cloudlets V3 API support
11+
* Cloudlet Info
12+
* [ListCloudlets](https://techdocs.akamai.com/cloudlets/reference/get-cloudlets)
13+
* Policies
14+
* [ListPolicies](https://techdocs.akamai.com/cloudlets/reference/get-policies)
15+
* [CreatePolicy](https://techdocs.akamai.com/cloudlets/reference/post-policy)
16+
* [DeletePolicy](https://techdocs.akamai.com/cloudlets/reference/delete-policy)
17+
* [GetPolicy](https://techdocs.akamai.com/cloudlets/reference/get-policy)
18+
* [UpdatePolicy](https://techdocs.akamai.com/cloudlets/reference/put-policy)
19+
* [ClonePolicy](https://techdocs.akamai.com/cloudlets/reference/post-policy-clone)
20+
* Policy Properties
21+
* [ListActivePolicyProperties](https://techdocs.akamai.com/cloudlets/reference/get-policy-properties)
22+
* Policy Versions
23+
* [ListPolicyVersions](https://techdocs.akamai.com/cloudlets/reference/get-policy-versions)
24+
* [GetPolicyVersion](https://techdocs.akamai.com/cloudlets/reference/get-policy-version)
25+
* [CreatePolicyVersion](https://techdocs.akamai.com/cloudlets/reference/post-policy-version)
26+
* [DeletePolicyVersion](https://techdocs.akamai.com/cloudlets/reference/delete-policy-version)
27+
* [UpdatePolicyVersion](https://techdocs.akamai.com/cloudlets/reference/put-policy-version)
28+
* Policy Activations
29+
* [ListPolicyActivations](https://techdocs.akamai.com/cloudlets/reference/get-policy-activations)
30+
* [GetPolicyActivation](https://techdocs.akamai.com/cloudlets/reference/get-policy-activation)
31+
* [ActivatePolicy and DeactivatePolicy](https://techdocs.akamai.com/cloudlets/reference/post-policy-activations)
32+
* Supported cloudlet types
33+
* API Prioritization (AP)
34+
* Application Segmentation (AS)
35+
* Edge Redirector (ER)
36+
* Forward Rewrite (FR)
37+
* Phased Release (PR aka CD)
38+
* Request Control (RC aka IG)
39+
40+
* DNS
41+
* Added `ListGroups` method
42+
* [ListGroups](https://techdocs.akamai.com/edge-dns/reference/get-data-groups)
43+
44+
* Edgeworkers
45+
* Added `note` field to `Activation` and `ActivateVersion` structs for EdgeWorkers Activation
46+
47+
* GTM
48+
* Added new fields to `DomainItem` struct
49+
50+
* IVM
51+
* Extended `OutputImage` for support of `AllowPristineOnDownsize` and `PreferModernFormats`
52+
* Extended `PolicyInputImage` for support of `ServeStaleDuration`
53+
* Extended `RolloutInfo` for support of `ServeStaleEndTime`
54+
55+
#### BUG FIXES:
56+
57+
* APPSEC
58+
* Added `updateLatestNetworkStatus` query parameter in GetActivations request to resolve drift on manual changes to infrastructure
59+
360
## 7.5.0 (November 28, 2023)
461

562
#### FEATURES/ENHANCEMENTS:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ COMMIT_SHA=$(shell git rev-parse --short HEAD)
33
VERSION ?= $(shell git describe --tags --always | grep '^v\d' || \
44
echo $(FILEVERSION)-$(COMMIT_SHA))
55
BIN = $(CURDIR)/bin
6-
GOLANGCI_LINT_VERSION = v1.52.2
6+
GOLANGCI_LINT_VERSION = v1.55.2
77
GO = go
88
TIMEOUT = 15
99
V = 0

go.mod

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ require (
88
github.com/google/uuid v1.1.1
99
github.com/mitchellh/go-homedir v1.1.0
1010
github.com/spf13/cast v1.3.1
11-
github.com/stretchr/testify v1.6.1
11+
github.com/stretchr/testify v1.8.4
1212
github.com/tj/assert v0.0.3
1313
go.uber.org/ratelimit v0.2.0
14+
golang.org/x/net v0.20.0
1415
gopkg.in/ini.v1 v1.51.1
1516
)
1617

@@ -23,7 +24,9 @@ require (
2324
github.com/pkg/errors v0.9.1 // indirect
2425
github.com/pmezard/go-difflib v1.0.0 // indirect
2526
github.com/smartystreets/goconvey v1.6.4 // indirect
26-
github.com/stretchr/objx v0.1.0 // indirect
27+
github.com/stretchr/objx v0.5.0 // indirect
28+
golang.org/x/mod v0.14.0 // indirect
29+
golang.org/x/tools v0.17.0 // indirect
2730
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
28-
gopkg.in/yaml.v3 v3.0.0 // indirect
31+
gopkg.in/yaml.v3 v3.0.1 // indirect
2932
)

go.sum

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,18 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
6262
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
6363
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
6464
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
65-
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
6665
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
66+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
67+
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
68+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
6769
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
6870
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
6971
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
70-
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
7172
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
73+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
74+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
75+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
76+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
7277
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
7378
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
7479
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
@@ -82,10 +87,14 @@ go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA=
8287
go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg=
8388
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
8489
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
90+
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
91+
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
8592
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
8693
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
8794
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
8895
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
96+
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
97+
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
8998
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
9099
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
91100
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -95,6 +104,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
95104
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
96105
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
97106
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
107+
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
108+
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
98109
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
99110
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
100111
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
@@ -107,5 +118,5 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
107118
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
108119
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
109120
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
110-
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
111-
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
121+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
122+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

pkg/appsec/activations.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"context"
55
"fmt"
66
"net/http"
7+
"net/url"
8+
"strconv"
79
"time"
810

911
validation "github.com/go-ozzo/ozzo-validation/v4"
@@ -168,11 +170,16 @@ func (p *appsec) GetActivations(ctx context.Context, params GetActivationsReques
168170
return nil, fmt.Errorf("%w: %s", ErrStructValidation, err.Error())
169171
}
170172

171-
uri := fmt.Sprintf(
172-
"/appsec/v1/activations/%d",
173-
params.ActivationID)
173+
uri, err := url.Parse(fmt.Sprintf("/appsec/v1/activations/%d", params.ActivationID))
174+
if err != nil {
175+
return nil, fmt.Errorf("failed to parse url: %s", err)
176+
}
174177

175-
req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil)
178+
q := uri.Query()
179+
q.Add("updateLatestNetworkStatus", strconv.FormatBool(true))
180+
uri.RawQuery = q.Encode()
181+
182+
req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri.String(), nil)
176183
if err != nil {
177184
return nil, fmt.Errorf("failed to create GetActivations request: %w", err)
178185
}

pkg/appsec/activations_test.go

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,81 @@ func TestAppSec_ListActivations(t *testing.T) {
9090
})
9191
}
9292
}
93+
94+
func TestAppSec_GetActivations(t *testing.T) {
95+
96+
result := GetActivationsResponse{}
97+
98+
respData := compactJSON(loadFixtureBytes("testdata/TestActivations/Activations.json"))
99+
err := json.Unmarshal([]byte(respData), &result)
100+
require.NoError(t, err)
101+
102+
tests := map[string]struct {
103+
params GetActivationsRequest
104+
responseStatus int
105+
responseBody string
106+
expectedPath string
107+
expectedResponse *GetActivationsResponse
108+
withError error
109+
headers http.Header
110+
}{
111+
"200 OK": {
112+
params: GetActivationsRequest{
113+
ActivationID: 32415,
114+
},
115+
headers: http.Header{
116+
"Content-Type": []string{"application/json"},
117+
},
118+
responseStatus: http.StatusOK,
119+
responseBody: string(respData),
120+
expectedPath: "/appsec/v1/activations/32415?updateLatestNetworkStatus=true",
121+
expectedResponse: &result,
122+
},
123+
"500 internal server error": {
124+
params: GetActivationsRequest{
125+
ActivationID: 32415,
126+
},
127+
headers: http.Header{},
128+
responseStatus: http.StatusInternalServerError,
129+
responseBody: `
130+
{
131+
"type": "internal_error",
132+
"title": "Internal Server Error",
133+
"detail": "Error fetching activations",
134+
"status": 500
135+
}`,
136+
expectedPath: "/appsec/v1/activations/32415?updateLatestNetworkStatus=true",
137+
withError: &Error{
138+
Type: "internal_error",
139+
Title: "Internal Server Error",
140+
Detail: "Error fetching activations",
141+
StatusCode: http.StatusInternalServerError,
142+
},
143+
},
144+
}
145+
146+
for name, test := range tests {
147+
t.Run(name, func(t *testing.T) {
148+
mockServer := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
149+
assert.Equal(t, test.expectedPath, r.URL.String())
150+
assert.Equal(t, http.MethodGet, r.Method)
151+
w.WriteHeader(test.responseStatus)
152+
_, err := w.Write([]byte(test.responseBody))
153+
assert.NoError(t, err)
154+
}))
155+
client := mockAPIClient(t, mockServer)
156+
result, err := client.GetActivations(
157+
session.ContextWithOptions(
158+
context.Background(),
159+
session.WithContextHeaders(test.headers),
160+
),
161+
test.params)
162+
if test.withError != nil {
163+
assert.True(t, errors.Is(err, test.withError), "want: %s; got: %s", test.withError, err)
164+
return
165+
}
166+
require.NoError(t, err)
167+
assert.Equal(t, test.expectedResponse, result)
168+
})
169+
}
170+
}

pkg/appsec/errors.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"fmt"
77
"io/ioutil"
88
"net/http"
9+
10+
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v7/pkg/errs"
911
)
1012

1113
var (
@@ -42,8 +44,8 @@ func (p *appsec) Error(r *http.Response) error {
4244

4345
if err := json.Unmarshal(body, &e); err != nil {
4446
p.Log(r.Request.Context()).Errorf("could not unmarshal API error: %s", err)
45-
e.Title = "Failed to unmarshal error body"
46-
e.Detail = err.Error()
47+
e.Title = "Failed to unmarshal error body. Application Security API failed. Check details for more information."
48+
e.Detail = errs.UnescapeContent(string(body))
4749
}
4850

4951
e.StatusCode = r.StatusCode

pkg/appsec/errors_test.go

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ func TestNewError(t *testing.T) {
5353
Request: req,
5454
},
5555
expected: &Error{
56-
Title: "Failed to unmarshal error body",
57-
Detail: "invalid character 'e' in literal true (expecting 'r')",
56+
Title: "Failed to unmarshal error body. Application Security API failed. Check details for more information.",
57+
Detail: "test",
5858
StatusCode: http.StatusInternalServerError,
5959
},
6060
},
@@ -66,3 +66,60 @@ func TestNewError(t *testing.T) {
6666
})
6767
}
6868
}
69+
70+
func TestJsonErrorUnmarshalling(t *testing.T) {
71+
req, err := http.NewRequestWithContext(
72+
context.TODO(),
73+
http.MethodHead,
74+
"/",
75+
nil)
76+
require.NoError(t, err)
77+
tests := map[string]struct {
78+
input *http.Response
79+
expected *Error
80+
}{
81+
"API failure with HTML response": {
82+
input: &http.Response{
83+
Request: req,
84+
Status: "OK",
85+
Body: ioutil.NopCloser(strings.NewReader(`<HTML><HEAD>...</HEAD><BODY>...</BODY></HTML>`))},
86+
expected: &Error{
87+
Type: "",
88+
Title: "Failed to unmarshal error body. Application Security API failed. Check details for more information.",
89+
Detail: "<HTML><HEAD>...</HEAD><BODY>...</BODY></HTML>",
90+
},
91+
},
92+
"API failure with plain text response": {
93+
input: &http.Response{
94+
Request: req,
95+
Status: "OK",
96+
Body: ioutil.NopCloser(strings.NewReader("Your request did not succeed as this operation has reached the limit for your account. Please try after 2024-01-16T15:20:55.945Z"))},
97+
expected: &Error{
98+
Type: "",
99+
Title: "Failed to unmarshal error body. Application Security API failed. Check details for more information.",
100+
Detail: "Your request did not succeed as this operation has reached the limit for your account. Please try after 2024-01-16T15:20:55.945Z",
101+
},
102+
},
103+
"API failure with XML response": {
104+
input: &http.Response{
105+
Request: req,
106+
Status: "OK",
107+
Body: ioutil.NopCloser(strings.NewReader(`<Root><Item id="1" name="Example" /></Root>`))},
108+
expected: &Error{
109+
Type: "",
110+
Title: "Failed to unmarshal error body. Application Security API failed. Check details for more information.",
111+
Detail: "<Root><Item id=\"1\" name=\"Example\" /></Root>",
112+
},
113+
},
114+
}
115+
116+
for name, test := range tests {
117+
t.Run(name, func(t *testing.T) {
118+
sess, _ := session.New()
119+
as := appsec{
120+
Session: sess,
121+
}
122+
assert.Equal(t, test.expected, as.Error(test.input))
123+
})
124+
}
125+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"dispatchCount" : 1,
3+
"activationId" : 32415,
4+
"action" : "deny",
5+
"status" : "ACTIVATED",
6+
"network" : "STAGING",
7+
"estimate" : "test",
8+
"createdBy" : "test_user",
9+
"createDate" : "2022-05-05T14:19:17Z",
10+
"activationConfigs" : [
11+
{
12+
"configId" : 43253,
13+
"ConfigName" : "activationConfig",
14+
"ConfigVersion": 1,
15+
"PreviousConfigVersion": 1
16+
}
17+
]
18+
}

pkg/botman/errors.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"io/ioutil"
88
"net/http"
99
"strings"
10+
11+
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v7/pkg/errs"
1012
)
1113

1214
type (
@@ -35,8 +37,8 @@ func (b *botman) Error(r *http.Response) error {
3537

3638
if err := json.Unmarshal(body, &e); err != nil {
3739
b.Log(r.Request.Context()).Errorf("could not unmarshal API error: %s", err)
38-
e.Title = "Failed to unmarshal error body"
39-
e.Detail = err.Error()
40+
e.Title = "Failed to unmarshal error body. Bot Manager API failed. Check details for more information."
41+
e.Detail = errs.UnescapeContent(string(body))
4042
}
4143

4244
e.StatusCode = r.StatusCode

0 commit comments

Comments
 (0)