core icon indicating copy to clipboard operation
core copied to clipboard

Invalid format of the config - User friendly message

Open LukasRychtecky opened this issue 7 years ago • 1 comments

Hi,

I've noticed that when config.edn is in invalid format (e.g. "Map literal must contain an even number of forms") in a stack trace you will see something like java.lang.RuntimeException: Map literal must contain an even number of forms, compiling:(dev.clj:41:11) after calling (dev) in REPL. It points into dev.clj which is confusing. What do you think about to wrap read-config in https://github.com/duct-framework/core/blob/master/src/duct/core.clj#L123 into try-catch and raise an exception within a message like: "Tip: Check you configuration in resources/fooproject/config.edn for format errors"?

LukasRychtecky avatar Apr 23 '18 16:04 LukasRychtecky

This is a good idea, but let's do it in a way that doesn't hide information from the developer either.

weavejester avatar Apr 25 '18 23:04 weavejester