Skip to content

Better handling for MM2.json config not found error #8

@damascene

Description

@damascene

When I launch the bot without having a config file MM2.json in pytomicDEX_makerbot/config/ I get the following error:

FileNotFoundError: Komodefi SDK config not found at /home/user/pytomicDEX_makerbot/config/MM2.json!

Traceback

coins file not found, downloading...
Traceback (most recent call last):
  File "/home/user/pytomicDEX_makerbot/makerbot.py", line 10, in <module>
    from models import Tui
  File "/home/user/pytomicDEX_makerbot/models.py", line 1069, in <module>
    table = Table()
            ^^^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 447, in __init__
    self.dex = Dex()
               ^^^^^
  File "/home/user/pytomicDEX_makerbot/models.py", line 45, in __init__
    self.api = pykomodefi.KomoDeFi_API(config=self.mm2_config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/top/.cache/pypoetry/virtualenvs/trading-5fBmn1aJ-py3.11/lib/python3.11/site-packages/pykomodefi/models.py", line 10, in __init__
    self.set_config(config)
  File "/home/top/.cache/pypoetry/virtualenvs/trading-5fBmn1aJ-py3.11/lib/python3.11/site-packages/pykomodefi/models.py", line 39, in set_config
    raise FileNotFoundError(f"Komodefi SDK config not found at {config}!")
FileNotFoundError: Komodefi SDK config not found at /home/user/pytomicDEX_makerbot/config/MM2.json!

I think printing an error and suggestion to get the file would be better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions