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

Consumer streams terminate on F.raiseError from EnvelopeDecoders #313

Open
Daenyth opened this issue Feb 7, 2020 · 3 comments
Open

Consumer streams terminate on F.raiseError from EnvelopeDecoders #313

Daenyth opened this issue Feb 7, 2020 · 3 comments

Comments

@Daenyth
Copy link
Collaborator

Daenyth commented Feb 7, 2020

This makes it a big pain to use with a parsed type.

Some options were explored in #151, but not completed.

We will want to provide some means to handle those automatically for users, because for example, json decoding using circe is a common use case, and you cannot prevent a publisher from submitting invalid json, or incorrect structure for your given circe.Decoder

As a workaround so far, I've found this useful:

  /** Convert a decoder producing `A` to a decode that handles failure with `Left` */
  implicit def fallibleDecoder[F[_], A, E](
      implicit decoder: EnvelopeDecoder[F, A],
      F: MonadError[F, E]
  ): EnvelopeDecoder[F, Either[E, A]] =
    decoder.attempt
@stale
Copy link

stale bot commented Jul 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 30, 2020
@Daenyth
Copy link
Collaborator Author

Daenyth commented Jul 30, 2020

@gvolpe ^ Is there a way we can configure that bot to exclude certain things?

@gvolpe gvolpe added the pinned label Jul 30, 2020
@gvolpe
Copy link
Member

gvolpe commented Jul 30, 2020

Added the pinned label, that should be enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants