mirror of https://github.com/MISP/PyMISP
Merge branch 'master' into logging
commit
ba6568eb46
|
@ -144,7 +144,7 @@ class PyMISP(object):
|
||||||
self.describe_types = describe_types['result']
|
self.describe_types = describe_types['result']
|
||||||
if not self.describe_types.get('sane_defaults'):
|
if not self.describe_types.get('sane_defaults'):
|
||||||
raise PyMISPError('The MISP server your are trying to reach is outdated (<2.4.52). Please use PyMISP v2.4.51.1 (pip install -I PyMISP==v2.4.51.1) and/or contact your administrator.')
|
raise PyMISPError('The MISP server your are trying to reach is outdated (<2.4.52). Please use PyMISP v2.4.51.1 (pip install -I PyMISP==v2.4.51.1) and/or contact your administrator.')
|
||||||
except:
|
except Exception:
|
||||||
with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f:
|
with open(os.path.join(self.ressources_path, 'describeTypes.json'), 'r') as f:
|
||||||
describe_types = json.load(f)
|
describe_types = json.load(f)
|
||||||
self.describe_types = describe_types['result']
|
self.describe_types = describe_types['result']
|
||||||
|
@ -212,7 +212,7 @@ class PyMISP(object):
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
try:
|
try:
|
||||||
to_return = response.json()
|
to_return = response.json()
|
||||||
except:
|
except ValueError:
|
||||||
logger.debug(response.text)
|
logger.debug(response.text)
|
||||||
raise PyMISPError('Unknown error: {}'.format(response.text))
|
raise PyMISPError('Unknown error: {}'.format(response.text))
|
||||||
|
|
||||||
|
@ -668,7 +668,7 @@ class PyMISP(object):
|
||||||
if event_id is not None:
|
if event_id is not None:
|
||||||
try:
|
try:
|
||||||
event_id = int(event_id)
|
event_id = int(event_id)
|
||||||
except:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
if not isinstance(event_id, int):
|
if not isinstance(event_id, int):
|
||||||
# New event
|
# New event
|
||||||
|
|
Loading…
Reference in New Issue