Skip to content

Forgetting a FromConfig / Generic instance compiles with runtime exception #96

@vikrem

Description

@vikrem

With the following program on GHC 8.10.7, conferer 1.1.0.0:

data Foo = Foo { secret :: Text }

appMain :: IO ()
appMain = do
  cfg <- mkConfig' [] [fromFilePath "config.properties"]
  appConfig' <- fetchFromConfig @Foo "" cfg
  exitSuccess

This compiles and runs, without deriving Generic or FromConfig. The application crashes with an exception:

app-exe: Failed to get a 'Foo' from keys: ""

Setting a secret key in config.properties doesn't help and the application continues to crash in the same manner.
Deliberately adding a blank instance of FromConfig, and deriving Generic fixes the problem, but there is no indication to do so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions