coc.py icon indicating copy to clipboard operation
coc.py copied to clipboard

Error when accessing current war data for clans that haven't participated in wars (for a longer time)

Open Anubhav1603 opened this issue 1 month ago • 3 comments

I'm experiencing an issue where methods like get_current_war and get_clan_war fail if the clan hasn't participated in any wars, even when the war log is set to public. This results in an error when trying to retrieve war data for such clans.

For example, using a valid clan tag like #2PPP that hasn't fought any wars yet leads to an error when calling these methods. It would be great if there could be better handling for such cases, perhaps returning a message like "Not found" or similar when the clan doesn't have any war data.

Current Behavior:

The get_current_war and get_clan_war methods throw an error when the clan hasn't participated in any wars. Steps to Reproduce:

  1. Use a clan tag of a clan that hasn't participated in any wars (e.g., #2PPP).
  2. Call get_current_war or get_clan_war.
  3. The request fails with an error.

Anubhav1603 avatar Feb 04 '25 03:02 Anubhav1603