Skip to content

Expose raw Failure and Payload protos on SDK error and result types#2231

Open
brucearctor wants to merge 1 commit intotemporalio:masterfrom
brucearctor:issue-2203
Open

Expose raw Failure and Payload protos on SDK error and result types#2231
brucearctor wants to merge 1 commit intotemporalio:masterfrom
brucearctor:issue-2203

Conversation

@brucearctor
Copy link

Objective

Fixes #2203 by exposing the full underlying proto data for errors and results from update/activities.

SDK users generally expect to be able to extract all raw details about failures and payloads when high-level helper methods do not cover all use cases (e.g., retrieving stack traces from the CLI without parsing error strings, or getting the original payload representation without relying on a data converter).

Changes

  • Error types: Renamed failure() to Failure() on the internal temporalError type, which is embedded in other public error types such as ApplicationError, TimeoutError, and ActivityError. This allows SDK users to retrieve the underlying *failurepb.Failure object directly. Adjusted the internal FailureHolder back to failureHolder to avoid method/field conflicts on NexusOperationError.
  • Result types: Added an optional ValuesPayloads interface to converter and a GetPayloads helper.
    • Why not add Payloads() *commonpb.Payloads directly to the EncodedValue and EncodedValues interfaces? Doing so would be a backwards-incompatible breaking change for any users outside of sdk-go that have implemented or mocked these interfaces.
    • With GetPayloads(encoded interface{}) *commonpb.Payloads, existing implementations won't break, but Temporal's internal EncodedValue implementations now satisfy the new interface, allowing extraction of the raw *commonpb.Payloads.
  • Updated the generated testing mocks.

@brucearctor brucearctor requested a review from a team as a code owner March 15, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose raw Failure and Payload protos on SDK error and result types

1 participant