From ffea337b926f2ce5ecf273082a87f9622f724d7e Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Wed, 16 Sep 2026 11:57:11 -0400 Subject: [PATCH] Log the REST error responder's application code, not a method value. Fixes #4410 - the debug field bound the Code method left behind by the AppCode rename, rendering a function value and failing to marshal under the JSON formatter; it now logs AppCode --- CHANGELOG.md | 1 + controller/response/responder.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4d705060..4048a0ffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -716,6 +716,7 @@ Thanks to the community members who contributed to this release. * github.com/openziti/xweb/v3: [v3.0.4 -> v3.0.5](https://github.com/openziti/xweb/compare/v3.0.4...v3.0.5) * github.com/openziti/ziti/v2: [v2.0.0 -> v2.1.0](https://github.com/openziti/ziti/compare/v2.0.0...v2.1.0) + * [Issue #4410](https://github.com/openziti/ziti/issues/4410) - REST error responder logs ApiError.Code as a method value * [Issue #4184](https://github.com/openziti/ziti/issues/4184) - Router leaks LinkSendBuffer goroutines in `drainDeadlines()` — circuits accumulate until the router OOMs * [Issue #4278](https://github.com/openziti/ziti/issues/4278) - fabric inspect data-model-index doesn't move for writes outside the router data model * [Issue #4196](https://github.com/openziti/ziti/issues/4196) - Router control-channel connect/disconnect race can leave a reconnected router de-registered diff --git a/controller/response/responder.go b/controller/response/responder.go index 28377c2f0..1e2578f9e 100644 --- a/controller/response/responder.go +++ b/controller/response/responder.go @@ -55,7 +55,7 @@ func (self EdgeResponseMapper) MapApiError(requestId string, apiError *errorz.Ap } func (self EdgeResponseMapper) toRestModel(e *errorz.ApiError, requestId string) *rest_model.APIError { - pfxlog.Logger().WithError(e).WithField("code", e.Code).Debug("returning error to REST API") + pfxlog.Logger().WithError(e).WithField("code", e.AppCode).Debug("returning error to REST API") ret := &rest_model.APIError{ Args: nil, Code: e.AppCode,