temporalio / temporalio/sdk-php
[Feature Request] FailureConverter allow more context in ordinary exceptions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 421
- Forks
- 64
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
Is your feature request related to a problem? Please describe.
We have older codebase where we have interfaces called UserExceptions and ApplicationExceptions based on this interfaces we know if error should be shown to user or not. Interfaces has also methods like getContext:array and getParameters:array which are similar to temporal failure details.
When temporal activity fails we are not throwing temporal failures since our app is bit old and has hundreds of such exceptions.
What SDK does is to call mapFailureToException and our context is lost here since it really just handles instance of temporal failures.
Describe the solution you'd like
Would be great if ApplicationFailure was an interface this way we can just force our exceptions to implement this and create details and don't have to extend ApplicationFailure all the way.
Event something like:
interface FailureWithDetails
public function getDetails(): ValuesInterface
would probably solve the problem.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading FailureConverter, especially mapFailureToException, along with ApplicationFailure and the existing UserExceptions and ApplicationExceptions interfaces described in the issue. Determine how ordinary exceptions could expose getDetails() without extending ApplicationFailure. Done means the conversion preserves the relevant context and parameters for these exceptions, with coverage for the affected conversion behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100