typelevel / typelevel/fs2

Determine Proper Error Handling for Thrown Exception in 2.x

Open
#2,132 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.5.x help wanted
Dominant language
Scala
Stars
2.5k
Forks
636
Avg merge
2d 4h
Merged PRs (30d)
7

Description

The guide's section on error handling provides the following example:

val err2 = Stream(1,2,3) ++ (throw new Exception("!@#$"))

The guide states that:

The handleErrorWith method lets us catch any of these errors...

However, this is not true for err2, which throws the exception even when .handleErrorWith is used.

For example, the expression below throws rather than yielding List("abc"):

err2.handleErrorWith(_ => Stream.emit("abc")).toList

M Pilquist stated the following in Gitter:

Hm, though fs2 3.x does in fact do that
ok yeah, it fails on fs2 2.x but passes on 3.x
Could you open an issue? Not sure what it should do but we can figure that out in the issue

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the guide's error-handling section and reproduce the err2 and handleErrorWith examples against fs2 2.x, then compare the stated behavior with fs2 3.x. Determine whether the intended resolution is a guide correction or a behavior change, and consider the issue done when the chosen behavior is implemented or documented consistently with a verified example.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.