Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OR-5281 Error handling :: Dealing with failure #135

Merged
merged 1 commit into from
Aug 16, 2023
Merged

OR-5281 Error handling :: Dealing with failure #135

merged 1 commit into from
Aug 16, 2023

Conversation

crazymanish
Copy link
Owner

Context

In this PR

  • All try* operators
  • The try-prefixed operators let you throw errors from within them, while non-try operators do not.
  • All try-prefixed operators in Combine behave the same way when it comes to errors.
  • Example: tryMap, tryFirst, tryLast etc


  • replaceError(with:) Replaces any errors in the stream with the provided element.
  • If the upstream publisher fails with an error, this publisher emits the provided element, then finishes normally.
  • This replaceError(with:) functionality is useful when you want to handle an error by sending a single replacement element and end the stream.
  • https://developer.apple.com/documentation/combine/deferred/replaceerror(with:)/

@crazymanish crazymanish linked an issue Aug 16, 2023 that may be closed by this pull request
@crazymanish crazymanish merged commit 8ee1869 into main Aug 16, 2023
@crazymanish crazymanish deleted the OR-5281 branch August 16, 2023 19:07
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.

[w30(23july-29july)] Error Handling: Dealing with failure
1 participant