Skip to content

get_rule_info() fails if a rule has no hit yet #2

@ruppde

Description

@ruppde

no matches according to https://valhalla.nextron-systems.com/info/rule/APT_NK_APT37_LNK_Jul22_1 gives this error:

>>> from valhallaAPI.valhalla import ValhallaAPI
>>> 
>>> v = ValhallaAPI(api_key="c...")
>>> response = v.get_rule_info(rulename="APT_NK_APT37_LNK_Jul22_1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/valhallaAPI/valhalla.py", line 145, in get_rule_info
    return json.loads(r.text)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions