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

Fix ConfigException#toString #68

Merged
merged 1 commit into from
Nov 11, 2017
Merged

Fix ConfigException#toString #68

merged 1 commit into from
Nov 11, 2017

Conversation

vlovgr
Copy link
Owner

@vlovgr vlovgr commented Nov 10, 2017

Ensures that the exception message is included in toString, and therefore also in stack traces.

scala> loadConfig(env[Int]("A"), prop[Int]("B"))(_ + _).orThrow()
ciris.ConfigException: configuration loading failed with the following errors.

  - Environment variable [A] with value [x] cannot be converted to type [Int]: java.lang.NumberFormatException: For input string: "x".
  - Missing system property [B].

  at ciris.ConfigException$.apply(ConfigException.scala:46)
  at ciris.ConfigErrors$.toException$extension(ConfigErrors.scala:109)
  at ciris.syntax$EitherConfigErrorsSyntax$.$anonfun$orThrow$1(syntax.scala:22)
  at ciris.syntax$EitherConfigErrorsSyntax$.$anonfun$orThrow$1$adapted(syntax.scala:22)
  at scala.util.Either.fold(Either.scala:189)
  at ciris.syntax$EitherConfigErrorsSyntax$.orThrow$extension(syntax.scala:23)
  ... 36 elided

@vlovgr vlovgr force-pushed the config-exception-message branch from cf88a70 to 490b2cf Compare November 10, 2017 16:42
@vlovgr vlovgr force-pushed the config-exception-message branch from 490b2cf to f249fb5 Compare November 11, 2017 09:57
@codecov
Copy link

codecov bot commented Nov 11, 2017

Codecov Report

Merging #68 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #68   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          28     28           
  Lines         433    433           
  Branches        3      3           
=====================================
  Hits          433    433
Impacted Files Coverage Δ
.../shared/src/main/scala/ciris/ConfigException.scala 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed2face...f249fb5. Read the comment docs.

@vlovgr vlovgr merged commit f74cb31 into master Nov 11, 2017
@vlovgr vlovgr deleted the config-exception-message branch November 11, 2017 10:23
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.

1 participant