sdk-php
sdk-php copied to clipboard
[Bug] Wrong exception trace
I'm trying to run Temporal with Symfony application and have problem with error tracing.
- I'm trying to run non-existent activity method (it exists, but report isn't about that)
I expect to see line in workflow where it calls, but I get error on call workflow method line and some vendor artefacts. See image

When I'm trying to roll the same behaviour from code similar to workshop I get the following stacktrace:
As you see sdk catches needed lines into stacktrace.
Similar situation when I dump exception directly in \Temporal\Internal\Client\WorkflowStub::mapWorkflowFailureToException

But as you can see in previous screenshot it's placed in originalStackTrace property.
Property trace doesn't contain that information so it's displays wrong.
Is it expected behaviour? Would be good to see "original stack trace" in usual "trace" property.
Hi, unfortunately, it is not possible to overwrite the PHP exception trace as it possible in Java. So the only option (from our perspective) was to include it into the originalStackTrace.
Ideally, we need to train exception renderers (or for example Sentry) to understand such types of exceptions and display them. This is partially important when an exception comes from another stack, you can't render something which is not within your codebase.
So this is an excepted behavior but ideally, we need some sugar to make it easier to read.
Closing as answered