{"action":"created","issue":{"url":"https://api.github.com/repos/mockturtl/cinnamon-weather/issues/177","repository_url":"https://api.github.com/repos/mockturtl/cinnamon-weather","labels_url":"https://api.github.com/repos/mockturtl/cinnamon-weather/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/mockturtl/cinnamon-weather/issues/177/comments","events_url":"https://api.github.com/repos/mockturtl/cinnamon-weather/issues/177/events","html_url":"https://github.com/mockturtl/cinnamon-weather/issues/177","id":198276355,"number":177,"title":"Weather data doesn't load until commenting out try-catch block in MyApplet.refreshWeather","user":{"login":"jaszhix","id":6859057,"avatar_url":"https://avatars.githubusercontent.com/u/6859057?v=3","gravatar_id":"","url":"https://api.github.com/users/jaszhix","html_url":"https://github.com/jaszhix","followers_url":"https://api.github.com/users/jaszhix/followers","following_url":"https://api.github.com/users/jaszhix/following{/other_user}","gists_url":"https://api.github.com/users/jaszhix/gists{/gist_id}","starred_url":"https://api.github.com/users/jaszhix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaszhix/subscriptions","organizations_url":"https://api.github.com/users/jaszhix/orgs","repos_url":"https://api.github.com/users/jaszhix/repos","events_url":"https://api.github.com/users/jaszhix/events{/privacy}","received_events_url":"https://api.github.com/users/jaszhix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-01T18:18:38Z","updated_at":"2017-01-29T20:04:55Z","closed_at":"2017-01-29T20:04:55Z","body":"Linux Mint 18.1\r\nCinnamon 3.2.7\r\nWeather 1.13.7\r\n\r\nFor some reason the applet only loads once on a fresh boot. If I restart Cinnamon or the applet, the http request never completes. When I comment out [this try-catch block](https://github.com/mockturtl/cinnamon-weather/blob/master/applet.js#L389), it works every time. I can see this might not be an issue if someone never restarts Cinnamon, but I think there must be a way to debug this. I see this in glass.log a lot every day:\r\n\r\n```sh\r\nerror t=2017-01-01T18:08:03.469Z weather@mockturtl#: TypeError: json.get_object_member(...).get_object_member(...) is null\r\n```\r\n\r\nIt seems like we could replace [this](https://github.com/mockturtl/cinnamon-weather/blob/master/applet.js#L369) with JSON.parse and have native formatting of the weather object. It would require rewriting all the lines accessing the object but would be a lot easier to read and debug.\r\n\r\nWhen I import Main and add ```Main._logInfo(message.response_body.data)``` on L370, I see\r\n\r\n```js\r\nerror t=2017-01-01T18:16:47.458Z weather@mockturtl#: TypeError: json.get_object_member(...).get_object_member(...) is null\r\ninfo t=2017-01-01T18:17:30.414Z {\"query\":{\"count\":0,\"created\":\"2017-01-01T18:17:30Z\",\"lang\":\"en-US\",\"results\":null}}\r\n```\r\n\r\nSo maybe when results is null, we could recurse the object for x amount of times, checking its value. I'm not sure why the request would return null, but I'm guessing its Soup's fault. I found [this](http://stackoverflow.com/questions/14806981/using-gjs-how-can-you-make-an-async-http-request-to-download-a-file-in-chunks), which also might be useful."},"comment":{"url":"https://api.github.com/repos/mockturtl/cinnamon-weather/issues/comments/275941801","html_url":"https://github.com/mockturtl/cinnamon-weather/issues/177#issuecomment-275941801","issue_url":"https://api.github.com/repos/mockturtl/cinnamon-weather/issues/177","id":275941801,"user":{"login":"mockturtl","id":705804,"avatar_url":"https://avatars.githubusercontent.com/u/705804?v=3","gravatar_id":"","url":"https://api.github.com/users/mockturtl","html_url":"https://github.com/mockturtl","followers_url":"https://api.github.com/users/mockturtl/followers","following_url":"https://api.github.com/users/mockturtl/following{/other_user}","gists_url":"https://api.github.com/users/mockturtl/gists{/gist_id}","starred_url":"https://api.github.com/users/mockturtl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mockturtl/subscriptions","organizations_url":"https://api.github.com/users/mockturtl/orgs","repos_url":"https://api.github.com/users/mockturtl/repos","events_url":"https://api.github.com/users/mockturtl/events{/privacy}","received_events_url":"https://api.github.com/users/mockturtl/received_events","type":"User","site_admin":false},"created_at":"2017-01-29T20:04:55Z","updated_at":"2017-01-29T20:04:55Z","body":"Hello,\r\n\r\nThis issue is being closed because development is moving to [linuxmint/cinnamon-spices/applets](https://github.com/linuxmint/cinnamon-spices-applets).  Feel free to reopen your issue there.\r\n\r\nPlease see the release announcement here:\r\n\r\nhttp://segfault.linuxmint.com/2017/01/changes-to-cinnamon-spices-for-developer-and-artists/"}}
{"actor":{"display_login":"mockturtl"}}