On Fri, Aug 5, 2016 at 1:31 AM, GBANE FETIGUE <beme...@gmail.com> wrote:
> try:
>     parsed_response = json.loads(response)
>     print "Your applicationId is: " + parsed_response[u'applicationId']
>     version_id = parsed_response[u'versionId']
>     print "Your versionId is: " + version_id
> except:
>     print 'Seems the named application already exists!'
>     print 'Seems the named versionId already exists!'
>

This is a very bad idea. You're catching every possible exception and
printing out the same message for all of them. And then continuing
blithely on. Instead, catch ONLY the exceptions you really expect to
be seeing (I'm guessing KeyError here). If anything else goes wrong,
let the exception bubble up.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to