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

chore(protocols): specify raised exceptions (part 2) #1268

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vladopajic
Copy link
Member

this PR specifies raised exceptions in protocols module. it is part 2, continuation to #1260.

part of #962 effort.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.26027% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (raises-protocol-handler-no@eca8bb1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
libp2p/protocols/connectivity/autonat/client.nim 97.14% 1 Missing ⚠️
libp2p/services/hpservice.nim 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                      @@
##             raises-protocol-handler-no    #1268   +/-   ##
=============================================================
  Coverage                              ?   84.55%           
=============================================================
  Files                                 ?       93           
  Lines                                 ?    16930           
  Branches                              ?        0           
=============================================================
  Hits                                  ?    14315           
  Misses                                ?     2615           
  Partials                              ?        0           
Files with missing lines Coverage Δ
libp2p/connmanager.nim 92.60% <ø> (ø)
libp2p/protocols/connectivity/autonat/server.nim 81.95% <ø> (ø)
libp2p/protocols/connectivity/autonat/service.nim 97.48% <100.00%> (ø)
libp2p/protocols/connectivity/dcutr/client.nim 76.78% <100.00%> (ø)
libp2p/protocols/connectivity/dcutr/core.nim 100.00% <100.00%> (ø)
libp2p/protocols/connectivity/relay/relay.nim 82.18% <100.00%> (ø)
libp2p/protocols/identify.nim 82.68% <100.00%> (ø)
libp2p/protocols/pubsub/pubsub.nim 85.00% <100.00%> (ø)
libp2p/protocols/rendezvous.nim 74.76% <100.00%> (ø)
libp2p/services/autorelayservice.nim 97.41% <100.00%> (ø)
... and 2 more

Base automatically changed from raises-protocol-handler-no to master February 25, 2025 21:33
try:
await (await incomingConnection).connection.close()
except:
discard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about the exception being generated here. Do you think it's worth it to add a trace log?

Copy link
Member Author

@vladopajic vladopajic Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i internationally didn't wanted to add log there, as compiler tells that AlreadyExpectingConnectionError can happen here, but, if this error happens it will happen only right after switch.connManager.expectConnection(pid, In) is called and that case is already handled. however i have added comment (to explain) and error log (it should never happen tho)

@vladopajic vladopajic enabled auto-merge (squash) February 27, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants