sdk-php icon indicating copy to clipboard operation
sdk-php copied to clipboard

[Bug] Wrong exception trace

Open xepozz opened this issue 4 years ago • 1 comments
trafficstars

I'm trying to run Temporal with Symfony application and have problem with error tracing.

  1. 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

image


When I'm trying to roll the same behaviour from code similar to workshop I get the following stacktrace:

image As you see sdk catches needed lines into stacktrace.

Similar situation when I dump exception directly in \Temporal\Internal\Client\WorkflowStub::mapWorkflowFailureToException image


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.

xepozz avatar Jul 03 '21 18:07 xepozz

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.

wolfy-j avatar Jul 04 '21 10:07 wolfy-j

Closing as answered

rustatian avatar Sep 01 '23 12:09 rustatian