{"action":"opened","issue":{"url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/708","labels_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/708/labels{/name}","comments_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/708/comments","events_url":"https://api.github.com/repos/nightwatchjs/nightwatch/issues/708/events","html_url":"https://github.com/nightwatchjs/nightwatch/issues/708","id":114070175,"number":708,"title":"nightwatch throws misleading error if globals_path module contains syntax error","user":{"login":"jenswegar","id":647808,"avatar_url":"https://avatars.githubusercontent.com/u/647808?v=3","gravatar_id":"","url":"https://api.github.com/users/jenswegar","html_url":"https://github.com/jenswegar","followers_url":"https://api.github.com/users/jenswegar/followers","following_url":"https://api.github.com/users/jenswegar/following{/other_user}","gists_url":"https://api.github.com/users/jenswegar/gists{/gist_id}","starred_url":"https://api.github.com/users/jenswegar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenswegar/subscriptions","organizations_url":"https://api.github.com/users/jenswegar/orgs","repos_url":"https://api.github.com/users/jenswegar/repos","events_url":"https://api.github.com/users/jenswegar/events{/privacy}","received_events_url":"https://api.github.com/users/jenswegar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T15:07:49Z","updated_at":"2015-10-29T15:07:49Z","closed_at":null,"body":"If one defines the globals_path property, and the module file exists but contains an error, then nightwatch throws a misleading error in the console: \r\n\r\n    Error: External global file could not be located - using nightwatch.globals.js.\r\n\r\nI would expect it to throw something like \"error parsing nightwatch.globals.js\" or similar, not talk about not being able to locate the file itself.\r\n\r\nexample conf (shortened, but rest is as per default example):\r\n\r\n```\r\n {\r\n   \"src_folders\" : [\"test/e2e\"],\r\n   \"output_folder\" : \"test/reports\",\r\n   \"globals_path\" : \"nightwatch.globals.js\",\r\n\r\n//....\r\n\r\n}\r\n```\r\nexample of nightwatch.globals.js:\r\n \r\n```\r\nmodule.exports = {\r\n  param1 : 'abc'\r\n  param2 : 'def'\r\n }\r\n```\r\nnote missing comma after 'abc'\r\n"}}