uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
339 stars 128 forks source link

Add a structured error for non-determinism failures #1269

Closed Groxx closed 10 months ago

Groxx commented 10 months ago

This is being added for a few reasons:

  1. it's useful information, and an unstructured error has no way to safely communicate it
  2. previously these were un-typed errors, so this custom type can be added without breaking backwards compatibility
  3. we want to use it to expose more information about shadow-test failures, which are currently far more opaque than they need to be

Shadow tests are opaque for a lot of reasons that need to be improved, but enhancing the error is a pretty straightforward first step. And it seems useful in general.

This intentionally does not change the .Error() text, largely just because I didn't see any reason to do so. The error strings are reasonably well-known and there doesn't seem to be any major benefit that can be gained by improving them... currently. That said, these strings must not be considered stable in general, and we should consider changing them in the future.