libp2p / libp2p/py-libp2p

Exceptions handling and structure

Open
#261 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted Interoperability
Dominant language
Python
Stars
624
Forks
256
Avg merge
1d 34m
Merged PRs (30d)
47

Description

  1. We should revisit the whole codebase to ensure exceptions are well defined and handled well.
  2. We don't have a good picture of the exception tree now. As a reference, in trinity, the package trinity has its own exception tree and so do p2p. I'm not sure what is the best structure for us, but I think probably a single exception tree(i.e. all exceptions inherit from BaseLibp2pError and its descendants) can be a start?

@ChihChengLiang @ralexstokes @NIC619 @pipermerriam

Would love to have your comment on it:)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing libp2p/exceptions.py and the linked Trinity and p2p exception trees. Then inventory exception definitions and handling across the codebase, and seek agreement on a hierarchy and handling policy. Done means the structure and scope are decided and the affected exceptions are consistently organized.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.