crawl icon indicating copy to clipboard operation
crawl copied to clipboard

Handle Config errors with great messages

Open benjaminestes opened this issue 7 years ago • 3 comments

The Config file is the most error-prone part of the process from the user's perspective. However, we can't really get around this — there are just a lot of choices to make. Let's make it as easy as possible to interpret errors.

benjaminestes avatar Oct 15 '18 16:10 benjaminestes

I think this is a good case for test-driven development. I'll start by creating some pathologically flawed config files — though really each can only trigger one error, so I may have to think through which errors to embed.

benjaminestes avatar Oct 17 '18 22:10 benjaminestes

Just experienced a good case that could use special handling: a config file with no From field, when in spider mode. Spider mode is useless without From, so crawl should check for it.

Are there other mandatory fields (possibly different in each mode) that should be checked for?

benjaminestes avatar Oct 22 '18 16:10 benjaminestes

Does Go's unmarshalling pattern allow for this to be easily checked?

benjaminestes avatar Oct 22 '18 16:10 benjaminestes