{"action":"created","issue":{"url":"https://api.github.com/repos/probmods/webppl/issues/489","repository_url":"https://api.github.com/repos/probmods/webppl","labels_url":"https://api.github.com/repos/probmods/webppl/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/probmods/webppl/issues/489/comments","events_url":"https://api.github.com/repos/probmods/webppl/issues/489/events","html_url":"https://github.com/probmods/webppl/issues/489","id":159690101,"number":489,"title":"Make returnify error more readable for models where the last statement is not an expression","user":{"login":"stuhlmueller","id":382515,"avatar_url":"https://avatars.githubusercontent.com/u/382515?v=3","gravatar_id":"","url":"https://api.github.com/users/stuhlmueller","html_url":"https://github.com/stuhlmueller","followers_url":"https://api.github.com/users/stuhlmueller/followers","following_url":"https://api.github.com/users/stuhlmueller/following{/other_user}","gists_url":"https://api.github.com/users/stuhlmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/stuhlmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuhlmueller/subscriptions","organizations_url":"https://api.github.com/users/stuhlmueller/orgs","repos_url":"https://api.github.com/users/stuhlmueller/repos","events_url":"https://api.github.com/users/stuhlmueller/events{/privacy}","received_events_url":"https://api.github.com/users/stuhlmueller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/probmods/webppl/labels/error%20handling","name":"error handling","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/probmods/webppl/milestones/3","html_url":"https://github.com/probmods/webppl/milestones/v0.9","labels_url":"https://api.github.com/repos/probmods/webppl/milestones/3/labels","id":1574240,"number":3,"title":"v0.9","description":"PPAML summer school","creator":{"login":"stuhlmueller","id":382515,"avatar_url":"https://avatars.githubusercontent.com/u/382515?v=3","gravatar_id":"","url":"https://api.github.com/users/stuhlmueller","html_url":"https://github.com/stuhlmueller","followers_url":"https://api.github.com/users/stuhlmueller/followers","following_url":"https://api.github.com/users/stuhlmueller/following{/other_user}","gists_url":"https://api.github.com/users/stuhlmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/stuhlmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stuhlmueller/subscriptions","organizations_url":"https://api.github.com/users/stuhlmueller/orgs","repos_url":"https://api.github.com/users/stuhlmueller/repos","events_url":"https://api.github.com/users/stuhlmueller/events{/privacy}","received_events_url":"https://api.github.com/users/stuhlmueller/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":5,"state":"open","created_at":"2016-02-10T06:27:24Z","updated_at":"2016-07-15T16:29:20Z","due_on":"2016-07-25T07:00:00Z","closed_at":null},"comments":2,"created_at":"2016-06-10T18:06:31Z","updated_at":"2016-07-19T15:35:40Z","closed_at":null,"body":"This is a subset of #331"},"comment":{"url":"https://api.github.com/repos/probmods/webppl/issues/comments/233672262","html_url":"https://github.com/probmods/webppl/issues/489#issuecomment-233672262","issue_url":"https://api.github.com/repos/probmods/webppl/issues/489","id":233672262,"user":{"login":"null-a","id":9109012,"avatar_url":"https://avatars.githubusercontent.com/u/9109012?v=3","gravatar_id":"","url":"https://api.github.com/users/null-a","html_url":"https://github.com/null-a","followers_url":"https://api.github.com/users/null-a/followers","following_url":"https://api.github.com/users/null-a/following{/other_user}","gists_url":"https://api.github.com/users/null-a/gists{/gist_id}","starred_url":"https://api.github.com/users/null-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/null-a/subscriptions","organizations_url":"https://api.github.com/users/null-a/orgs","repos_url":"https://api.github.com/users/null-a/repos","events_url":"https://api.github.com/users/null-a/events{/privacy}","received_events_url":"https://api.github.com/users/null-a/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T15:35:40Z","updated_at":"2016-07-19T15:35:40Z","body":"> I'm guessing this is more than changing the string on this line:\r\n\r\nPerhaps, but only a *little* more...\r\n\r\nThe problematic error arises when trying to run a program like this:\r\n\r\n```js\r\nvar a = 0;\r\n```\r\n\r\nWhich produces:\r\n\r\n```\r\n{ type: 'VariableDeclaration',\r\n  declarations: \r\n   [ { type: 'VariableDeclarator',\r\n       id: [Object],\r\n       init: [Object],\r\n       range: [Object],\r\n       loc: [Object] } ],\r\n  kind: 'var',\r\n  range: [ 0, 9 ],\r\n  loc: \r\n   { start: { line: 1, column: 0 },\r\n     end: { line: 1, column: 9 },\r\n     source: 'test.wppl' } }\r\nreturnify\r\npath/to/webppl/webppl:56\r\n      throw error;\r\n      ^\r\n\r\nError: returnify\r\n    at path/to/webppl/src/syntax.js:20:11\r\n    ... more stack trace ...\r\n```\r\n\r\nThat error is generated by the function returned from `fail` on the line you mentioned.\r\n\r\nI imagine that making following changes would probably produce acceptable results:\r\n\r\n1. Don't show the ast node.\r\n2. Have a more descriptive message, explain how to fix the problem.\r\n3. Perhaps loose the JS stack trace which doesn't seem useful for users. We could `throw` a string rather than an `Error` to achieve this.\r\n\r\nSo, perhaps not *too* much more than just changing the string?\r\n"}}
{"actor":{"display_login":"null-a"}}