Skip to content

Instantly share code, notes, and snippets.

@stleamist
Created November 27, 2020 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stleamist/fbd75357b900968eab8e79698e8d594b to your computer and use it in GitHub Desktop.
Save stleamist/fbd75357b900968eab8e79698e8d594b to your computer and use it in GitHub Desktop.
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