Skip to content

More detailed exceptions #137

@6r1d

Description

@6r1d

Today, sgull reported an error while trying to run the most basic documentation example while using a default config from the docs.

import json
from iroha2 import Client

cfg = json.loads(open("config.json").read())
cl = Client(cfg)

This is the error log, which, honestly, doesn't tell a lot to respond about:

Exception                                 Traceback (most recent call last)
Cell In[55], line 6
      4 cfg = json.loads(open("config.json").read())
      5 # cfg
----> 6 cl = Client(cfg)

File ~/.local/lib/python3.10/site-packages/iroha2/__init__.py:13, in Client.__init__(self, cfg, headers)
     11 def __init__(self, cfg, headers=None):
     12     if headers is None:
---> 13         self.cl = _Client(cfg)
     14     else:
     15         self.cl = _Client.with_headers(cfg, headers)

This error also repeats when he tries to run a test.py file.

We need to report if it's a malformed config that:

  • Can't be parsed
  • Misses some of the keys
  • Doesn't allow Iroha 2 client to connect
  • etc.

I'm certain there are several things I'm currently missing, and that doesn't allow to respond to the users. Let us discuss those and return to them later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementiroha2Pull requests and issues associated with iroha 2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions