Created
November 27, 2020 06:28
-
-
Save stleamist/fbd75357b900968eab8e79698e8d594b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
public extension Publisher { | |
func replaceError(with transform: @escaping (Self.Failure) -> Self.Output) -> Publishers.Catch<Self, Publishers.ReplaceError<Self>> { | |
return self.catch { error in | |
return self.replaceError(with: transform(error)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment