redpanda-data / redpanda-data/connect
Consider clearing errors at the beginning of a try block
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.8k
- Forks
- 969
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 64
Description
Right now nested try blocks within catch will never trigger:
pipeline:
processors:
- try:
- resource: foo
- catch:
- try:
- resource: bar
- resource: baz
So if foo fails neither bar nor baz would execute. This is because the error context is carried into the processors of the catch block and aren't cleared until the end so that the error message can be referrenced. A work around is to add a nested catch before the try block:
pipeline:
processors:
- try:
- resource: foo
- catch:
- catch: []
- try:
- resource: bar
- resource: baz
This clears the error before the try block but looks odd and ugly.
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
Reproduce the nested YAML pipeline with try, catch, and the foo, bar, and baz resources. Trace how the error context moves through these pipeline processors and determine how clearing it at the start of a try should affect nested execution. Done means bar and baz run after foo fails without requiring an empty nested catch, while the original error remains available for the catch block.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- stream-processing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100