Update Try except statements throughout project
MSAdministrator opened this issue · comments
Small PR attached for this one file issue. I lost a couple of hours to this (path with dash instead of underscore, arg!).
There are many other occurrences of except: pass
or except: return None
throughout the project. Almost all of those could/should be improved. I don't have the context for the original author's decision so difficult to say what they were expecting might fail. Example from technique.py
:
try:
for item in self._RELATIONSHIPS[self.stix]:
if item in item_dict:
return_list.append(PreAttckActor(preattck_obj=self.__preattck_obj, **item_dict[item]))
except:
pass
Where did the author think this might fail? Is that okay? What error is actually raised? Should it really be ignored?
I will not be working through these other items but they should probably be on somebody's TODO list.
Originally posted by @mcarpenter in #93 (comment)