Better reporting of errors in config files #965

kinlum opened this Issue Feb 1, 2013 · 2 comments


None yet

3 participants

kinlum commented Feb 1, 2013

This is a possible improvement: If I start up a Mojito server, but added 1 comment to the file mojits/hello/defaults.json:

"someName" : "someValue" // TODO: correct this value later

which is illegal in a .json file but is an easy mistake to make.

and then did something else, such as update my package dependencies, and some code changes, and so forth, and I restart the server, then when loading the mojit, it will fail with:

error: (mojito-composite-addon): Error executing child mojit at 'child': error: (mojito-composite-addon): Cannot expand instance [@hello], or instance.controller is undefined error: (mojito-composite-addon): Error: Cannot expand instance [@hello], or instance.controller is undefined at YUI.add.Y.namespace.Dispatcher.dispatch (/mnt/

Can the error show a message about mojits/hello/defaults.json having an issue? Otherwise, it might need to be hunted down and we will need to be looking at other code changes, or even look at the package dependencies and see if it might be the cause, and a lot of time could be wasted. (since it has an error but won't tell you where it is). If it can report mojits/hello/defaults.json is causing it, the time can be just 1 minute.

caridy commented Feb 1, 2013

We can definitely improve error messages when it comes to invalid files and syntax errors.

In the case of the comments, you can get use to use .yaml files instead of .json to be able to add comments (supported in 0.5.x). You don't need to rework the content, u just need to rename and add your yaml comments.

rwaldura commented Feb 2, 2013

@kinlum Agreed! Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment