Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

unable to read zio.Duration #1096

Closed
bilal-fazlani opened this issue Mar 3, 2023 · 3 comments · Fixed by #1102
Closed

unable to read zio.Duration #1096

bilal-fazlani opened this issue Mar 3, 2023 · 3 comments · Fixed by #1102

Comments

@bilal-fazlani
Copy link

zioConfigVersion : 4.0.0-RC10

object TestApp3 extends zio.ZIOAppDefault:
  val configString = "duration = 5m"
  val config       = Config.duration("duration")

  override val bootstrap: ZLayer[Any, Nothing, Unit] =
    Runtime.setConfigProvider(
      TypesafeConfigProvider
        .fromHoconString(configString)
    )

  def run = ZIO
    .config(config)
    .debug("result")
    .exitCode

Error:

<FAIL> result: Fail((Invalid data at duration: Expected a duration value, but found 5m),Stack trace for thread "zio-fiber-4":
        at example.TestApp3.run(TestApp.scala:131)
        at example.TestApp3.run(TestApp.scala:132)
        at example.TestApp3.run(TestApp.scala:133))
@bilal-fazlani
Copy link
Author

PS: This used to in earlier versions

@afsalthaj
Copy link
Collaborator

#1090 (comment)

@afsalthaj
Copy link
Collaborator

Closing this issue here as it is related to zio core

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants