Skip to content

Commit

Permalink
when priting error content, use 600 chars, not 300.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Oct 11, 2023
1 parent 2413b63 commit 2e793c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clients/internal/base/base_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ func (c *SourceClientBase) GetRequest(resourceSubpathOrNext string, decodeModelP
if resp.StatusCode >= 300 || resp.StatusCode < 200 {
b, _ := io.ReadAll(resp.Body)
bodyContent := string(b)
if len(bodyContent) > 300 {
bodyContent = bodyContent[:300]
if len(bodyContent) > 600 {
bodyContent = bodyContent[:600]
}
c.LoggerDebugResponse(resp, true)
return "", fmt.Errorf("An error occurred during request %s - %d - %s [%s]", resourceUrl, resp.StatusCode, resp.Status, bodyContent)
Expand Down Expand Up @@ -279,9 +279,9 @@ func (c *SourceClientBase) GetRequest(resourceSubpathOrNext string, decodeModelP
return resourceUrl.String(), err
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Helper Functions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
func UnmarshalJson(r io.Reader, decodeModelPtr interface{}) error {
decoder := json.NewDecoder(r)
//decoder.DisallowUnknownFields() //make sure we throw an error if unknown fields are present.
Expand Down

0 comments on commit 2e793c1

Please sign in to comment.