jenglish / ssptool

nodejs / express application for working with OpenControl data
MIT License
3 stars 5 forks source link

Empty ssptool.yaml file causes error #12

Closed git-ingham closed 5 years ago

git-ingham commented 5 years ago

If I create an empty ssptool.yaml, I get the following error:

$ > ssptool.yaml
$ node main.js server
Loading data...
Cannot set property '_errors' of undefined
$ rm ssptool.yaml
$ node main.js server
Loading data...
Initializing...
Listening on http://localhost:3000
Ready.

If an ssptool.yaml must have contents, it would be nice to get a better error message.

(side note: it would be nice to know what can go into that file)

jenglish commented 5 years ago

Should be fixed now.

(side note: it would be nice to know what can go into that file)

Mainly it's the command-line options (datadir: and docdir:), plus document definitions. Updated the wiki to try to make this more apparent.

The authoritative definition of config file contents is the json-schema in lib/config.js; ssptool validate also checks the configuration file.