Skip to content

Commit

Permalink
Fixes #164: Catch new MISPClient exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
3c7 committed Jan 9, 2018
1 parent 2be3a87 commit 7456d49
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions analyzers/MISP/misp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from cortexutils.analyzer import Analyzer
from mispclient import MISPClient
from mispclient import MISPClient, MISPClientError


class MISPAnalyzer(Analyzer):
Expand All @@ -13,11 +13,15 @@ def __init__(self):
name = self.getParam('config.name', None)
if not name:
name = 'Unnamed'

self.misp = MISPClient(url=self.getParam('config.url', None, 'No MISP url given.'),
key=self.getParam('config.key', None, 'No MISP api key given.'),
ssl=self.getParam('config.certpath', True),
name=name)
try:
self.misp = MISPClient(url=self.getParam('config.url', None, 'No MISP url given.'),
key=self.getParam('config.key', None, 'No MISP api key given.'),
ssl=self.getParam('config.certpath', True),
name=name)
except MISPClientError as e:
self.error(str(e))
except TypeError as te:
self.error(str(te))

def summary(self, raw):
taxonomies = []
Expand Down

0 comments on commit 7456d49

Please sign in to comment.