Skip to content

Conversation

hearnadam
Copy link
Collaborator

/closes #9756

exitCode operator is dangerous as it swallows all errors. Since this is no longer necessary for creating a ZIOApp, it should no longer be used.

@hearnadam hearnadam requested a review from kyri-petrou June 16, 2025 22:00
@hearnadam
Copy link
Collaborator Author

Ah, I will mark the required usages as nowarn - I will followup.

/closes #9756

`exitCode` operator is dangerous as it swallows all errors. Since this is no longer necessary for creating a ZIOApp, it should no longer be used.
@hearnadam hearnadam requested review from ghostdogpr and guizmaii June 26, 2025 00:11
@@ -21,7 +22,9 @@ private[zio] trait ZIOAppPlatformSpecific { self: ZIOApp =>
runtime <- ZIO.runtime[Environment with ZIOAppArgs]
_ <- installSignalHandlers(runtime)
_ <- runtime.run(ZIO.scoped[Environment with ZIOAppArgs](run)).tapErrorCause(ZIO.logErrorCause(_))
} yield ()).provideLayer(newLayer.tapErrorCause(ZIO.logErrorCause(_))).exitCode.tap(exit)
} yield ()).provideLayer(newLayer.tapErrorCause(ZIO.logErrorCause(_))).exitCode.tap(exit): @nowarn(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JVM/native version does not have this. I will followup with a separate PR if that's alright.

@hearnadam hearnadam enabled auto-merge (squash) June 26, 2025 00:24
@hearnadam hearnadam merged commit b6ae352 into series/2.x Jun 26, 2025
19 checks passed
@hearnadam hearnadam deleted the exitcode branch June 26, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants