Skip to content

Commit

Permalink
fix(debug): fix /raw-error endpoint not serving raw response body (#6801
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pmalek authored Dec 9, 2024
1 parent 1523c85 commit 5ac94d2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/dataplane/kong_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,16 +813,19 @@ func (c *KongClient) sendToClient(
updateErr sendconfig.UpdateError
responseParsingErr sendconfig.ResponseParsingError
)
if errors.As(err, &updateErr) {

switch {
case errors.As(err, &updateErr):
reason := KongConfigurationApplyFailedEventReason
if isFallback {
reason = FallbackKongConfigurationApplyFailedEventReason
}
c.recordResourceFailureEvents(updateErr.ResourceFailures(), reason)
}
if errors.As(err, &responseParsingErr) {
rawResponseBody = updateErr.RawResponseBody()
case errors.As(err, &responseParsingErr):
rawResponseBody = responseParsingErr.ResponseBody()
}

sendDiagnostic(diagnostics.DumpMeta{Failed: true, Hash: string(newConfigSHA)}, rawResponseBody)

if err := ctx.Err(); err != nil {
Expand Down

0 comments on commit 5ac94d2

Please sign in to comment.