chg: Catch timeouts when pushing to MISP

pull/263/head
Raphaël Vinot 2021-09-10 15:25:37 +02:00
parent d1f673f3a7
commit 22d8672131
1 changed files with 4 additions and 1 deletions

View File

@ -100,7 +100,10 @@ class MISP():
return {'error': events}
to_return = []
for event in events:
new_event = self.client.add_event(event, pythonify=True)
try:
new_event = self.client.add_event(event, pythonify=True)
except requests.exceptions.ReadTimeout:
return {'error': 'The connection to MISP timed out, try increasing the timeout in the config.'}
if isinstance(new_event, MISPEvent):
to_return.append(new_event)
else: