Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when no event are reported by the API #10

Closed
bitonio opened this issue Sep 21, 2023 · 0 comments · Fixed by #11
Closed

Exception when no event are reported by the API #10

bitonio opened this issue Sep 21, 2023 · 0 comments · Fixed by #11
Assignees
Labels
bug Something isn't working

Comments

@bitonio
Copy link
Collaborator

bitonio commented Sep 21, 2023

When querying report where no data is available, cli-etp raise an exception.

% akamai etp event threat --start $(( $(date +%s) - 60000 ))
2023-09-21 15:10:40,040 cli-etp MainThread E Error fetching summary...
Traceback (most recent call last):
  File "/Users/androcho/.akamai-cli/src/cli-etp/bin/akamai-etp", line 337, in events_summary
    return data.get("aggregations", [])[0].get("total")
IndexError: list index out of range
Traceback (most recent call last):
  File "/Users/androcho/.akamai-cli/src/cli-etp/bin/akamai-etp", line 735, in <module>
    main()
  File "/Users/androcho/.akamai-cli/src/cli-etp/bin/akamai-etp", line 666, in main
    fetch_events_concurrent(config, out)
  File "/Users/androcho/.akamai-cli/src/cli-etp/bin/akamai-etp", line 405, in fetch_events_concurrent
    LOG.info(f"{stats.events:,} event(s) fetched in total, {expected_event_count:,} expected, "
TypeError: unsupported format string passed to NoneType.__format__
@bitonio bitonio added the bug Something isn't working label Sep 21, 2023
@bitonio bitonio self-assigned this Sep 21, 2023
@bitonio bitonio linked a pull request Sep 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant