Skip to content

trivial failing test case for non-existing catch_error operator - #281

Open
mightyiam wants to merge 1 commit into
rxRust:masterfrom
molybdenumsoftware:catch_error
Open

trivial failing test case for non-existing catch_error operator#281
mightyiam wants to merge 1 commit into
rxRust:masterfrom
molybdenumsoftware:catch_error

Conversation

@mightyiam

@mightyiam mightyiam commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Hey, this is a very low effort, even a non-contribution, especially since the absence of catch_error is recognized:

- `map_err` exists, but `catch_error` (switch to new observable on error) is missing.

Is anyone implementing catch_erro or planning to implement it?
I would like to think that I can do it, but I am concerned that there might be a "good" reason it's not implemented yet and that the reason is that it's not easy and might require some prior complex refactoring. But I'm just contemplating. What do you maintainers think? Can/should a user look into this?

Co-authored-by: shivaraj-bh me@shivaraj-bh.in

@mightyiam
mightyiam marked this pull request as ready for review July 4, 2026 08:19
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.38%. Comparing base (0e638ae) to head (f53bd8d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #281      +/-   ##
==========================================
- Coverage   82.43%   82.38%   -0.05%     
==========================================
  Files          84       84              
  Lines       11810    11816       +6     
==========================================
  Hits         9735     9735              
- Misses       2075     2081       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@M-Adoo

M-Adoo commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for opening this. catch_error is definitely a missing operator, and contributions for it are welcome.

For the implementation, retry should be the best existing operator to reference, because catch_error also needs to keep the same downstream observer and switch to another subscription after an error. The main difference is that catch_error should subscribe to the fallback observable returned by the handler, rather than resubscribing to the original source.

For the first version, I think it is fine to keep the semantics simple: source values pass through, source completion completes normally, source error calls the handler and switches to the fallback observable. The fallback should then forward its values/completion/error downstream.

@mightyiam

Copy link
Copy Markdown
Contributor Author

Thank you for responding! Looking at retry sounds like a great tip! We already started, but mostly by reading through existing operators. If an expert wants to one-shot catch_error, please don't hold back, but do let us know 😅. Otherwise, we are scheduled for another session Saturday.

@mightyiam

Copy link
Copy Markdown
Contributor Author

Hey. Just an update report. I know that this is only one operator, but it has been quite a challenge, and it seems we have made progress.

@mightyiam

Copy link
Copy Markdown
Contributor Author

I think we have it nearly figured out today.

@mightyiam

Copy link
Copy Markdown
Contributor Author

Still coming along.

Co-authored-by: shivaraj-bh <me@shivaraj-bh.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants