Improve error message when trying to open a config file.

Fixes #5666

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>