-
Couldn't load subscription status.
- Fork 1.4k
Extend causes in the Exit.getOrThrow* methods with stack traces #9386
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
Conversation
486e62d to
9d759c0
Compare
|
@kyri-petrou stack traces are different on:
|
2f73680 to
7c22a10
Compare
c5625f8 to
a4fc7b2
Compare
|
We could use this at $work. Anything missing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking this long to review this.
I think it looks good, the only issue is that I'm not sure whether the stream changes are needed as part of this PR
| * Converts this stream into a `scala.collection.Iterator` wrapped in a scoped | ||
| * [[ZIO]]. The returned iterator will only be valid within the scope. | ||
| */ | ||
| def toIterator(implicit trace: Trace): ZIO[R with Scope, Nothing, Iterator[Either[E, A]]] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why was this change (and the other stream ones) needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they were throwing a FiberFailure
| private[zio] def unfoldPull[R, A]( | ||
| runtime: Runtime[R], | ||
| pull: ZIO[R, Option[Throwable], A] | ||
| )(implicit trace: Trace, unsafe: Unsafe): Iterator[A] = | ||
| runtime.unsafe.run(pull) match { | ||
| case Exit.Success(value) => | ||
| Iterator.single(value) ++ unfoldPull(runtime, pull) | ||
| case Exit.Failure(cause) => | ||
| cause.failureOrCause match { | ||
| case Left(None) => Iterator.empty | ||
| case Left(Some(e)) => Exit.fail(e).getOrThrow() | ||
| case Right(c) => Exit.failCause(c).getOrThrowFiberFailure() | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used in streams, if you still need it I would move it to that package and make it private[stream]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea 👍
| val builder = ChunkBuilder.make[String]() | ||
| var size = 0 | ||
| /** Pretty-prints this cause with the provided `println` function. */ | ||
| final def prettyPrintWith(println: String => Unit)(implicit unsafe: Unsafe): Unit = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change the argument name to something different? Calling println looks very wrong
The idea is that most users call those methods in interop code and since they are leaving the ZIO runtime, they need a stack trace. Also override `printStackTrace` in `FiberFailure` by delegating to a new `Cause.prettyPrintWith` method which allows for a custom `println` function. This is necessary because the original method uses the private `stackTrace` field, not `getStackTrace`. Updated `Cause` to remove the "Exception in thread" part as this shouldn't be part of the exception `toString`, it's added later and was causing it to be printed twice. Last thing to node is that I didn't change `FiberFailure.toString` for caution of breaking user code but it's not in line with Java exceptions, which don't include the stack trace in their `toString`.
Rename `prettyPrintWith` argument, make it `private[zio]`
25281a7 to
6a96623
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed something in the previous round, but otherwise looks good to me!
| pull <- either.toPull | ||
| } yield unfoldPull(runtime, pull)(trace, Unsafe.unsafe).flatten |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling that this will destroy chunking, or at the very least cause each element of the stream to be evaluated in a new call to runtime.unsafe.run. This will be very expensive as each time we'd need to create a new Fiber to evaluate it. If we can't reuse unfoldPull I'd say it's probably better to specialize this implementation instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull returns a Chunk, that's why we call .flatten
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aghh I see
| if (TestVersion.isScala2) | ||
| """java.util.NoSuchElementException: head of empty list | ||
| | at scala.collection.immutable.Nil$.head | ||
| | at zio.StackTracesSpec$.$anonfun$spec | ||
| | at zio.ZIO.$anonfun$map | ||
| | at zio.StackTracesSpec.spec.underlyingFailure | ||
| | at zio.StackTracesSpec.spec | ||
| |""".stripMargin | ||
| else | ||
| """java.util.NoSuchElementException: head of empty list | ||
| | at scala.collection.immutable.Nil$.head | ||
| | at zio.StackTracesSpec$.$anonfun | ||
| | at zio.ZIO.map$$anonfun | ||
| | at zio.StackTracesSpec.spec.underlyingFailure | ||
| | at zio.StackTracesSpec.spec | ||
| |""".stripMargin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 stack traces look the same to me, or did I miss some difference between them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zio.ZIO.$anonfun$map vs zio.ZIO.map$$anonfun 😄
…9386) * Extend causes in the Exit.getOrThrow* methods with stack traces The idea is that most users call those methods in interop code and since they are leaving the ZIO runtime, they need a stack trace. Also override `printStackTrace` in `FiberFailure` by delegating to a new `Cause.prettyPrintWith` method which allows for a custom `println` function. This is necessary because the original method uses the private `stackTrace` field, not `getStackTrace`. Updated `Cause` to remove the "Exception in thread" part as this shouldn't be part of the exception `toString`, it's added later and was causing it to be printed twice. Last thing to node is that I didn't change `FiberFailure.toString` for caution of breaking user code but it's not in line with Java exceptions, which don't include the stack trace in their `toString`. * Extract unfoldPull * Fix broken tests * Add tests for getOrThrow stack traces * Test entire traces in StackTracesSpec * Move unfoldPull to steam package object Rename `prettyPrintWith` argument, make it `private[zio]`
commit 5d4d9fb Merge: dd9a4d4 d2bc5fd Author: Eyal Farago-Hagag <[email protected]> Date: Sat May 31 10:50:23 2025 +0300 Merge branch 'series/2.x' into stream_par_optimizations_a3 commit dd9a4d4 Author: Eyal Farago-Hagag <[email protected]> Date: Sat May 31 10:48:54 2025 +0300 stream_par_optimizations_a3: fmt commit 1776963 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 19:41:59 2025 +0300 stream_par_optimizations_a3: fix an elusive race condition, fibers may be interrupted BEFORE starting, and actually never started, resulting with a hung fiber commit 01eca4e Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 17:34:28 2025 +0300 stream_par_optimizations_a3: fix one more issue... (99 remaining..) commit c455134 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 15:34:35 2025 +0300 stream_par_optimizations_a3: use the light semaphore for the ordered version as well commit 56f57fe Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 11:44:28 2025 +0300 stream_par_optimizations_a2: remove View import which is broken in scala 2.12, optimize imports, fmt commit 3b9f217 Merge: e57471d 29b3055 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 11:24:39 2025 +0300 Merge branch 'series/2.x' into stream_par_optimizations_a2 commit e57471d Author: Eyal Farago-Hagag <[email protected]> Date: Thu May 29 15:48:24 2025 +0300 stream_par_optimizations_a2: fmt commit c9bcc82 Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Thu May 29 01:17:27 2025 +0000 Update zio-http to 3.3.2 (zio#9905) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit 91fb5c5 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed May 28 13:40:31 2025 -0700 fix(deps): update tailwindcss monorepo to v4.1.8 (zio#9904) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 207a2d0 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu May 29 00:11:32 2025 +1000 fix(deps): update dependency @zio.dev/zio-http to v3.3.2 (zio#9903) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit bb2de19 Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Wed May 28 10:48:50 2025 +1000 Update zio-http to 3.3.1 (zio#9897) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit db4df92 Author: kyri-petrou <[email protected]> Date: Tue May 27 20:58:54 2025 +0300 Rollback update to `sbt-ci-release` (zio#9894) commit a9ea879 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 27 09:54:26 2025 -0700 fix(deps): update dependency @zio.dev/zio-http to v3.3.1 (zio#9892) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 29e7cfd Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 27 09:31:18 2025 -0700 chore(deps): update dependency @types/react to v19.1.6 (zio#9891) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit b099630 Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Mon May 26 19:10:18 2025 +0300 Update sbt-ci-release to 1.11.0 (zio#9885) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit 7a4704a Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Fri May 23 18:02:25 2025 -0700 Update zio-http to 3.3.0 (zio#9884) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit be2cf76 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed May 21 11:03:43 2025 -0700 fix(deps): update dependency @zio.dev/zio-http to v3.3.0 (zio#9879) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 40c16ac Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed May 21 10:17:40 2025 -0700 chore(deps): update dependency @types/react to v19.1.5 (zio#9876) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit f7b2a19 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon May 19 10:16:48 2025 -0700 fix(deps): update dependency @zio.dev/zio-schema to v1.7.2 (zio#9873) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit b2bbd09 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Fri May 16 08:06:45 2025 -0600 fix(deps): update dependency @zio.dev/zio-schema to v1.7.1 (zio#9865) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 1362c98 Author: kyri-petrou <[email protected]> Date: Thu May 15 20:59:36 2025 -0600 Ignore failing Cause test (zio#9863) commit 2f8bc64 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu May 15 16:41:45 2025 +0000 fix(deps): update tailwindcss monorepo to v4.1.7 (zio#9861) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit f544529 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 13 14:52:11 2025 +1000 chore(deps): update dependency @types/react to v19.1.4 (zio#9856) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 19f6dd4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat May 10 14:49:56 2025 -0600 fix(deps): update dependency @zio.dev/zio-json to v0.7.43 (zio#9852) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit bbc9846 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Fri May 9 14:44:51 2025 -0700 fix(deps): update tailwindcss monorepo to v4.1.6 (zio#9849) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 68ff3b5 Author: Andrzej Ressel <[email protected]> Date: Tue May 6 16:59:36 2025 +0200 Replace <:<[R0 & out, R] with proper proof (zio#9840) * Reapply "Replace <:<[R0 & Any, R] with proper proof" This reverts commit 52b5db8. * Fix order of operations * Replace throw with errorAndAbort * Inline given commit f41354e Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 6 06:47:06 2025 -0700 chore(deps): update dependency @types/react to v19.1.3 (zio#9841) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 291c39e Author: Georgi Krastev <[email protected]> Date: Tue May 6 11:43:28 2025 +0300 Extend causes in the Exit.getOrThrow* methods with stack traces (zio#9386) * Extend causes in the Exit.getOrThrow* methods with stack traces The idea is that most users call those methods in interop code and since they are leaving the ZIO runtime, they need a stack trace. Also override `printStackTrace` in `FiberFailure` by delegating to a new `Cause.prettyPrintWith` method which allows for a custom `println` function. This is necessary because the original method uses the private `stackTrace` field, not `getStackTrace`. Updated `Cause` to remove the "Exception in thread" part as this shouldn't be part of the exception `toString`, it's added later and was causing it to be printed twice. Last thing to node is that I didn't change `FiberFailure.toString` for caution of breaking user code but it's not in line with Java exceptions, which don't include the stack trace in their `toString`. * Extract unfoldPull * Fix broken tests * Add tests for getOrThrow stack traces * Test entire traces in StackTracesSpec * Move unfoldPull to steam package object Rename `prettyPrintWith` argument, make it `private[zio]` commit 141211d Author: Andrzej Ressel <[email protected]> Date: Mon May 5 08:39:39 2025 +0200 Replace <:<[R0 & Any, R] with <:<[R0 & out, R] (zio#9838) * Replace <:<[R0 & Any, R] with <:<[R0 & out, R] * Replace <:<[R0 & Any, R] with proper proof * Revert "Replace <:<[R0 & Any, R] with proper proof" This reverts commit 4dbeab8. commit 5932fbc Author: Eyal Farago-Hagag <[email protected]> Date: Thu May 29 09:48:48 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: document mapOutZIOPar commit a1261e6 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 08:19:15 2025 +0300 stream_par_optimizations_a2: eliminate latches in mapZIOPar commit 48d1872 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 07:44:48 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: fix mapOutZIOPar commit 9d1ce86 Author: Eyal Farago-Hagag <[email protected]> Date: Sun May 25 09:24:20 2025 +0300 stream_par_optimizations_a2: eliminate childScope (par ordered) commit f09e3fb Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 2 18:12:44 2025 +0300 stream_par_optimizations_a2: correct version commit 66a09e5 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 2 16:55:50 2025 +0300 stream_par_optimizations_a2: strm.mapZIOPar: safely use forkDaemon
commit 04321d8b375f5c0c46dbcc89eeaade8607f5d41b Merge: fbdb1c68b36 3b9f217 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 11:28:03 2025 +0300 Merge branch 'stream_par_optimizations_a2' into stream_par_optimizations_a2_mapZIOParUnordered commit fbdb1c68b36045a7a0e54247506f1d1e41aa2eec Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 11:27:08 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: fmt commit 3b9f217 Merge: e57471d 29b3055 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 30 11:24:39 2025 +0300 Merge branch 'series/2.x' into stream_par_optimizations_a2 commit e57471d Author: Eyal Farago-Hagag <[email protected]> Date: Thu May 29 15:48:24 2025 +0300 stream_par_optimizations_a2: fmt commit c62d7b995b587119278ed57b322cfc68b39b95b9 Author: Eyal Farago-Hagag <[email protected]> Date: Thu May 29 09:48:48 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: document mapOutZIOPar commit c9bcc82 Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Thu May 29 01:17:27 2025 +0000 Update zio-http to 3.3.2 (zio#9905) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit 91fb5c5 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed May 28 13:40:31 2025 -0700 fix(deps): update tailwindcss monorepo to v4.1.8 (zio#9904) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 207a2d0 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu May 29 00:11:32 2025 +1000 fix(deps): update dependency @zio.dev/zio-http to v3.3.2 (zio#9903) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit bb2de19 Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Wed May 28 10:48:50 2025 +1000 Update zio-http to 3.3.1 (zio#9897) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit db4df92 Author: kyri-petrou <[email protected]> Date: Tue May 27 20:58:54 2025 +0300 Rollback update to `sbt-ci-release` (zio#9894) commit a9ea879 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 27 09:54:26 2025 -0700 fix(deps): update dependency @zio.dev/zio-http to v3.3.1 (zio#9892) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 29e7cfd Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 27 09:31:18 2025 -0700 chore(deps): update dependency @types/react to v19.1.6 (zio#9891) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 5c46f538af6356b7062c0de163fccc085e92749b Author: Eyal Farago-Hagag <[email protected]> Date: Tue May 27 09:11:36 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered__no_latch: document the unordered impl commit dfbd99b9d73784cbe7b7910c6f2417375dfc2544 Author: Eyal Farago-Hagag <[email protected]> Date: Tue May 27 08:34:50 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered__no_latch: slight refactoring of the light sem commit d0bf9bdc7ccfa553e720d7617fe0968dc0650bf7 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 21:57:28 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered__no_latch: implement a very simple and usecase specific semaphore to limit the number of fibers commit b099630 Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Mon May 26 19:10:18 2025 +0300 Update sbt-ci-release to 1.11.0 (zio#9885) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit a4c19e59e03b23fc27a13142f515be9c58b3472e Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 19:04:58 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered__no_latch: remove the latch, only to find out that there's now absolutely no cap over fibers forking commit e50e5471e0a6ea51e7681bbd3fb6cfb3c5ba8a69 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 08:19:15 2025 +0300 stream_par_optimizations_a2: eliminate latches in mapZIOPar commit cedd408ed356c16f0e0ab138f35e82d95631beb3 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 07:37:20 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: fix mapOutZIOPar commit 28836b460c16c5aa261b7ceb082aa702743928ef Author: Eyal Farago-Hagag <[email protected]> Date: Sun May 25 09:24:20 2025 +0300 stream_par_optimizations_a2: eliminate childScope (par ordered) commit 28e91d33604947d00543100e676d704d9b08e740 Author: Eyal Farago-Hagag <[email protected]> Date: Sun May 25 08:49:52 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: eliminate childScope (unordered) commit 5587af3213405984cbba240551f317d293b15043 Author: Eyal Farago-Hagag <[email protected]> Date: Sat May 24 11:19:24 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: introduce a concurrent dequeue based fibers list impl, use it in order to optimize mapZIOParUnordered commit 7a4704a Author: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> Date: Fri May 23 18:02:25 2025 -0700 Update zio-http to 3.3.0 (zio#9884) Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com> commit 3d919611723c55e8ad9db821c39c4fb064097321 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 23 11:54:52 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: optimize using a doubly linked list where every fiber unlinks itself when terminated commit be2cf76 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed May 21 11:03:43 2025 -0700 fix(deps): update dependency @zio.dev/zio-http to v3.3.0 (zio#9879) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 40c16ac Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed May 21 10:17:40 2025 -0700 chore(deps): update dependency @types/react to v19.1.5 (zio#9876) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit f7b2a19 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon May 19 10:16:48 2025 -0700 fix(deps): update dependency @zio.dev/zio-schema to v1.7.2 (zio#9873) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit b2bbd09 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Fri May 16 08:06:45 2025 -0600 fix(deps): update dependency @zio.dev/zio-schema to v1.7.1 (zio#9865) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 1362c98 Author: kyri-petrou <[email protected]> Date: Thu May 15 20:59:36 2025 -0600 Ignore failing Cause test (zio#9863) commit 2f8bc64 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu May 15 16:41:45 2025 +0000 fix(deps): update tailwindcss monorepo to v4.1.7 (zio#9861) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit f544529 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 13 14:52:11 2025 +1000 chore(deps): update dependency @types/react to v19.1.4 (zio#9856) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 19f6dd4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat May 10 14:49:56 2025 -0600 fix(deps): update dependency @zio.dev/zio-json to v0.7.43 (zio#9852) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit bbc9846 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Fri May 9 14:44:51 2025 -0700 fix(deps): update tailwindcss monorepo to v4.1.6 (zio#9849) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 68ff3b5 Author: Andrzej Ressel <[email protected]> Date: Tue May 6 16:59:36 2025 +0200 Replace <:<[R0 & out, R] with proper proof (zio#9840) * Reapply "Replace <:<[R0 & Any, R] with proper proof" This reverts commit 52b5db8. * Fix order of operations * Replace throw with errorAndAbort * Inline given commit f41354e Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue May 6 06:47:06 2025 -0700 chore(deps): update dependency @types/react to v19.1.3 (zio#9841) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 291c39e Author: Georgi Krastev <[email protected]> Date: Tue May 6 11:43:28 2025 +0300 Extend causes in the Exit.getOrThrow* methods with stack traces (zio#9386) * Extend causes in the Exit.getOrThrow* methods with stack traces The idea is that most users call those methods in interop code and since they are leaving the ZIO runtime, they need a stack trace. Also override `printStackTrace` in `FiberFailure` by delegating to a new `Cause.prettyPrintWith` method which allows for a custom `println` function. This is necessary because the original method uses the private `stackTrace` field, not `getStackTrace`. Updated `Cause` to remove the "Exception in thread" part as this shouldn't be part of the exception `toString`, it's added later and was causing it to be printed twice. Last thing to node is that I didn't change `FiberFailure.toString` for caution of breaking user code but it's not in line with Java exceptions, which don't include the stack trace in their `toString`. * Extract unfoldPull * Fix broken tests * Add tests for getOrThrow stack traces * Test entire traces in StackTracesSpec * Move unfoldPull to steam package object Rename `prettyPrintWith` argument, make it `private[zio]` commit 141211d Author: Andrzej Ressel <[email protected]> Date: Mon May 5 08:39:39 2025 +0200 Replace <:<[R0 & Any, R] with <:<[R0 & out, R] (zio#9838) * Replace <:<[R0 & Any, R] with <:<[R0 & out, R] * Replace <:<[R0 & Any, R] with proper proof * Revert "Replace <:<[R0 & Any, R] with proper proof" This reverts commit 4dbeab8. commit 5932fbc Author: Eyal Farago-Hagag <[email protected]> Date: Thu May 29 09:48:48 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: document mapOutZIOPar commit a1261e6 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 08:19:15 2025 +0300 stream_par_optimizations_a2: eliminate latches in mapZIOPar commit 48d1872 Author: Eyal Farago-Hagag <[email protected]> Date: Mon May 26 07:44:48 2025 +0300 stream_par_optimizations_a2_mapZIOParUnordered: fix mapOutZIOPar commit 9d1ce86 Author: Eyal Farago-Hagag <[email protected]> Date: Sun May 25 09:24:20 2025 +0300 stream_par_optimizations_a2: eliminate childScope (par ordered) commit f48aae27c67335a33207473340c3f91ab46687bd Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 2 18:12:44 2025 +0300 stream_par_optimizations_a2: correct version commit f09e3fb Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 2 18:12:44 2025 +0300 stream_par_optimizations_a2: correct version commit 8c03f2e1325dd772bad17ee1281fbb4e24e62453 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 2 16:55:50 2025 +0300 stream_par_optimizations_a2: strm.mapZIOPar: safely use forkDaemon commit 66a09e5 Author: Eyal Farago-Hagag <[email protected]> Date: Fri May 2 16:55:50 2025 +0300 stream_par_optimizations_a2: strm.mapZIOPar: safely use forkDaemon
fixes #9025
/claim #9025
The idea is that most users call those methods in interop code
and since they are leaving the ZIO runtime, they need a stack trace.
Also override
printStackTraceinFiberFailureby delegatingto a new
Cause.prettyPrintWithmethod which allows for a customprintlnfunction. This is necessary because the original methoduses the private
stackTracefield, notgetStackTrace.Updated
Causeto remove the "Exception in thread" part as thisshouldn't be part of the exception
toString, it's added later andwas causing it to be printed twice.
Last thing to node is that I didn't change
FiberFailure.toStringfor caution of breaking user code but it's not in line with Java
exceptions, which don't include the stack trace in their
toString.