{"action":"created","issue":{"url":"https://api.github.com/repos/GordonsBeard/cafe-flask/issues/9","labels_url":"https://api.github.com/repos/GordonsBeard/cafe-flask/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/GordonsBeard/cafe-flask/issues/9/comments","events_url":"https://api.github.com/repos/GordonsBeard/cafe-flask/issues/9/events","html_url":"https://github.com/GordonsBeard/cafe-flask/issues/9","id":56029997,"number":9,"title":"Don't specify exception types in caching try/except block?","user":{"login":"Lancey6","id":10087863,"avatar_url":"https://avatars.githubusercontent.com/u/10087863?v=3","gravatar_id":"","url":"https://api.github.com/users/Lancey6","html_url":"https://github.com/Lancey6","followers_url":"https://api.github.com/users/Lancey6/followers","following_url":"https://api.github.com/users/Lancey6/following{/other_user}","gists_url":"https://api.github.com/users/Lancey6/gists{/gist_id}","starred_url":"https://api.github.com/users/Lancey6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lancey6/subscriptions","organizations_url":"https://api.github.com/users/Lancey6/orgs","repos_url":"https://api.github.com/users/Lancey6/repos","events_url":"https://api.github.com/users/Lancey6/events{/privacy}","received_events_url":"https://api.github.com/users/Lancey6/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GordonsBeard/cafe-flask/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/GordonsBeard/cafe-flask/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-30T12:54:47Z","updated_at":"2015-01-30T17:43:37Z","closed_at":null,"body":"In the current caching implementation (at least in community.py), I use a try/except block to update the cache data if an error occurs while reading it. Multiple exceptions can be thrown during the process of reading the cache data, including receiving invalid data and being unable to read the file.\r\n\r\nAt the moment I specify the kinds of exceptions to catch. I consider this to be good practice, so that if something bad happens (such as an exception unrelated to caching) it'll be raised normally. However, there's a number of things that can go wrong in the caching process, and some errors I can't account for. Should we continue specifying the exceptions to catch or should we use a general except clause that will refresh cache information regardless of error?"},"comment":{"url":"https://api.github.com/repos/GordonsBeard/cafe-flask/issues/comments/72240047","html_url":"https://github.com/GordonsBeard/cafe-flask/issues/9#issuecomment-72240047","issue_url":"https://api.github.com/repos/GordonsBeard/cafe-flask/issues/9","id":72240047,"user":{"login":"GordonsBeard","id":4015791,"avatar_url":"https://avatars.githubusercontent.com/u/4015791?v=3","gravatar_id":"","url":"https://api.github.com/users/GordonsBeard","html_url":"https://github.com/GordonsBeard","followers_url":"https://api.github.com/users/GordonsBeard/followers","following_url":"https://api.github.com/users/GordonsBeard/following{/other_user}","gists_url":"https://api.github.com/users/GordonsBeard/gists{/gist_id}","starred_url":"https://api.github.com/users/GordonsBeard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GordonsBeard/subscriptions","organizations_url":"https://api.github.com/users/GordonsBeard/orgs","repos_url":"https://api.github.com/users/GordonsBeard/repos","events_url":"https://api.github.com/users/GordonsBeard/events{/privacy}","received_events_url":"https://api.github.com/users/GordonsBeard/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T17:43:37Z","updated_at":"2015-01-30T17:43:37Z","body":"I always favor being specific with the exceptions only because there are only so many types of failures we should be expecting.\r\n\r\nA general \"catch all\" at the end would be alright for debugging purposes or instrumentation - just to see how often our normal exception handling fails."}}