error if the config file is invalid

This stops surprising the developer when their config file is ignored due to a typo.

Is there a preferred function over `error`?