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

Support graceful degradation for new pets and new potions hopla-feed-all #262

Closed
melvio opened this issue Sep 2, 2024 · 1 comment · Fixed by #266
Closed

Support graceful degradation for new pets and new potions hopla-feed-all #262

melvio opened this issue Sep 2, 2024 · 1 comment · Fixed by #266
Assignees
Labels
enhancement New features or semantic improvements high-priority hopla-feed-all hopla feed-all command

Comments

@melvio
Copy link
Owner

melvio commented Sep 2, 2024

Problem: Every new pet and potion added by habitica causes hopla to fail. In particular the hopla feed-all subcommand. (e.g. issue #234)
proposed solution: Update code such that hopla still feeds all not-yet supported pets and potions until the pets/potions are added later.

See: issue #236 for same ticket for hatch-all

@melvio
Copy link
Owner Author

melvio commented Sep 23, 2024

Currently failing on 'Raccoon':

[DEBUG][kickstart.py|2024-09-23T14:06:07] start application with arguments: ['/home/m/.local/bin/hopla', 'feed-all']
[DEBUG][feed_all.py|2024-09-23T14:06:07] hopla feed-all no_interactive=False
[DEBUG][connectionpool.py|2024-09-23T14:06:07] Starting new HTTPS connection (1): habitica.com:443
[DEBUG][connectionpool.py|2024-09-23T14:06:08] https://habitica.com:443 "GET /api/v3/user HTTP/1.1" 200 None
Traceback (most recent call last):
  File "/home/m/.local/bin/hopla", line 8, in <module>
    sys.exit(setup_hopla_application())
  File "/home/m/.local/lib/python3.8/site-packages/hopla/__init__.py", line 29, in setup_hopla_application
    kickstart_hopla()
  File "/home/m/.local/lib/python3.8/site-packages/hopla/kickstart.py", line 160, in kickstart_hopla
    hopla()
  File "/home/m/.local/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/m/.local/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/m/.local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/m/.local/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/m/.local/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/m/.local/lib/python3.8/site-packages/hopla/cli/feed_all.py", line 98, in feed_all
    plan: FeedPlan = __get_feed_plan_or_exit()
  File "/home/m/.local/lib/python3.8/site-packages/hopla/cli/feed_all.py", line 27, in __get_feed_plan_or_exit
    zoo: Zoo = ZooBuilder(user).build()
  File "/home/m/.local/lib/python3.8/site-packages/hopla/hoplalib/zoo/zoomodels.py", line 81, in build
    pet = Pet(pet_name, feed_status=FeedStatus(feed_status))
  File "/home/m/.local/lib/python3.8/site-packages/hopla/hoplalib/zoo/petmodels.py", line 40, in __init__
    raise InvalidPet(f"{pet_name=} is not recognized by hopla.\n"
hopla.hoplalib.zoo.petmodels.InvalidPet: pet_name='Raccoon-Base' is not recognized by hopla.
Potential causes: 
* did you spell it correctly?
* Is your pet relatively new? If so, please raise
 an issue at https://github.com/melvio/hopla/issues/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or semantic improvements high-priority hopla-feed-all hopla feed-all command
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant