python - Does "Exception" capture all other "Concrete Exceptions" -
i'm having issues tweepy while running streaming api, question isn't directly related tweepy.
i have been getting multiple exceptions , thought "catch/pass" time being, temporary solution, until find out problem is.
as of now, tweepy has been throwing 5 different errors (incompleteread, protocolerror, unicodedecodeerror, attributeerror, typeerror)
, , they're resulting filter api not me obtaining data.
the line have in common traceback is:
twitterstream.filter(locations=[-125.22, 31.61, -104.86, 49.0, -104.86, 26.11, -66.94, 49.03])
incompleteread
, protocolerror
related different packages tweepy uses. (unicodedecodeerror, attributeerror, typeerror)
concrete exceptions.
my question:
am right assume exception base class can capture (the last 3)? or incorrect?
the documentation exception states
all built-in, non-system-exiting exceptions derived class
so exception base class should able capture those, non-system-exiting (an example of system-exiting exception systemexit). can test if you'd like:
try: raise attributeerror except exception: print("we caught exception!")
that said, blindly capturing exception base class considered bad idea because end capturing exceptions won't want to.
Comments
Post a Comment