You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CxODEV-1884: carry a diagnostic message on the structured_error contract
Backport of the 4.2.0 change to the 3.8 line, which consuming services
pin. Identical patch: the five touched files were byte-identical between
v3.8.0 and master.
StructuredErrorException supported only code and reason, so callers that
need both a short, stable reason and a detailed explanation had nowhere to
put the detail and had to fold it into reason. That defeats matching on
reason downstream, and leaves consumers with no separate diagnostic field.
Add StructuredError.Message, populated from the exception. No Message
property is added to the exception itself -- it already has one by virtue
of being an Exception, and the new constructors set it via base(). The
mapping only emits message when it differs from reason, so payloads from
existing call sites are byte-identical and the field is omitted entirely
(NullValueHandling.Ignore), keeping the shape at version 1.
message trails referenceError in the new constructors rather than
following reason. Overload resolution cannot pick between
(code, reason, referenceError, message) and the existing
(code, reason, referenceError, innerException) when the fourth argument is
an untyped null -- and (code, reason, message, null), a message with no
drill-down URI, is the common case. Placing the nullable parameter third
leaves only (code, reason, referenceError, null) ambiguous, which the
three-argument constructor already expresses.
Both execution managers had a hand-copied exception-to-payload mapping and
the test mirrored rather than called it, so a new field could pass tests
while being silently dropped by the type-poll path. Extract the mapping
into StructuredError.FromException and point all three at it.
Released as 3.8.1 rather than a 3.8.0-suffixed build: under semver a
hyphenated suffix is a pre-release and sorts before 3.8.0, so consumers on
3.8.0 would never be offered it as an upgrade.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments