Skip to content

Conversation

@acruikshank
Copy link

I left out a comma in my database.json file the first time I tried to run an update. I got an error like:

Cannot find module '/Path/to/Project/Path/to/project/database.json'

which made me think that the problem was with the location of my config file or with node-db-migrate itself. This pull request throws a syntax error if the file is found in the default location but cannot be read. Thanks.

lib/config.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to add curly brackets to the if-statement to maintain the conventions in the rest of the code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I added a commit to fix it.

@mex
Copy link
Contributor

mex commented Feb 6, 2014

I've stumbled upon this before, it'll be nice to get a syntax error instead of a confusing (and misleading) error message.

kunklejr added a commit that referenced this pull request Feb 7, 2014
better error handling for broken database.json files
@kunklejr kunklejr merged commit f6e8e39 into db-migrate:master Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants