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

define proper parent error type for YamuxError #1040

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

etan-status
Copy link
Contributor

All errors raised by nim-libp2p should descend from LPError. YamuxError was not correctly classified. Proposing it to be a specialized MuxerError, in line with mplex and muxer errors.

All errors raised by `nim-libp2p` should descend from `LPError`.
`YamuxError` was not correctly classified. Proposing it to be a
specialized `MuxerError`, in line with `mplex` and `muxer` errors.
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.77%. Comparing base (6c87348) to head (29d9c1d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           unstable    #1040   +/-   ##
=========================================
  Coverage     82.77%   82.77%           
=========================================
  Files            91       91           
  Lines         15604    15604           
=========================================
  Hits          12916    12916           
  Misses         2688     2688           
Files Coverage Δ
libp2p/muxers/yamux/yamux.nim 88.34% <ø> (ø)

@etan-status etan-status merged commit 78e8388 into unstable Mar 4, 2024
11 checks passed
@etan-status etan-status deleted the dev/etan/ym-exhierarchy branch March 4, 2024 18:26
@diegomrsantos
Copy link
Contributor

diegomrsantos commented Mar 13, 2024

@etan-status Could you please explain what LPError means and why errors should descend from it?

@dryajov
Copy link
Contributor

dryajov commented Mar 13, 2024

@etan-status Could you please explain what LPError means and why errors should descend from it?

LPError is the root object of libp2p's error hierarchy - this has always been it's original intent.

@diegomrsantos
Copy link
Contributor

Thanks, I meant literally, what does the name mean?

@dryajov
Copy link
Contributor

dryajov commented Mar 13, 2024

Thanks, I meant literally, what does the name mean?

Oh, heh - the LP prefix was chosen as a shorthand for libp2p, otherwise we'd be writing something like Libp2pError all over the place :)

@diegomrsantos
Copy link
Contributor

I see, maybe P2PError would be more descriptive?

@dryajov
Copy link
Contributor

dryajov commented Mar 13, 2024

I see, maybe P2PError would be more descriptive?

well, imo p2p is quite generic and LP is a well established convention in nim libp2p, I personally don't see a need to change it, but I'm also don't feel very strongly about it.

@diegomrsantos
Copy link
Contributor

It never crossed my mind that LP means libp2p. I believe a comment or docs would be beneficial.

@etan-status
Copy link
Contributor Author

@etan-status Could you please explain what LPError means and why errors should descend from it?

It's a followup from #582. LPError is the root of all nim-libp2p originated errors. That convention is mostly followed, with very few individual exceptions that are being addressed. Rationale is so that {.async: (raises).} can be restricted to the parent for the outermost layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

3 participants