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

Refactor errors #209

Merged
merged 1 commit into from
Mar 9, 2020
Merged

Refactor errors #209

merged 1 commit into from
Mar 9, 2020

Conversation

at-wat
Copy link
Member

@at-wat at-wat commented Mar 5, 2020

Wrap all errors to implement net.Error.
Caller of Read/Write can check err.(net.Error).Temporary() to determine whether the error is fatal or not, as with raw net.UDPConn.

Split errInvalidPacketLength from errLengthMismatch.
errInvalidPacketLength is used for errors caused by incoming data, which must be discarded, and errLengthMismatch is used for errors due to the data generated by the library, which is a fatal internal error.

@at-wat at-wat force-pushed the refactor-errors branch from 6d5f6a4 to c81b4ff Compare March 5, 2020 10:40
@at-wat at-wat force-pushed the refactor-errors branch from c81b4ff to 08e9c93 Compare March 5, 2020 10:54
@codecov
Copy link

codecov bot commented Mar 5, 2020

Codecov Report

Merging #209 into master will decrease coverage by 0.11%.
The diff coverage is 72.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #209      +/-   ##
==========================================
- Coverage   77.09%   76.97%   -0.12%     
==========================================
  Files          75       77       +2     
  Lines        4055     4086      +31     
==========================================
+ Hits         3126     3145      +19     
- Misses        627      636       +9     
- Partials      302      305       +3
Flag Coverage Δ
#go 77% <75.51%> (-0.06%) ⬇️
#wasm 71.99% <62.79%> (+0.2%) ⬆️
Impacted Files Coverage Δ
errors_noerrno.go 0% <0%> (ø)
record_layer.go 68.42% <100%> (ø) ⬆️
errors_errno.go 62.5% <62.5%> (ø)
errors.go 79.41% <76.66%> (+10.18%) ⬆️
conn.go 83.97% <77.77%> (+0.35%) ⬆️
internal/net/udp/conn.go 80.46% <0%> (-4.69%) ⬇️
internal/net/deadline/deadline.go 82.45% <0%> (-3.51%) ⬇️
internal/net/dpipe/dpipe.go 96.47% <0%> (+2.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a60060...3ee958c. Read the comment docs.

@at-wat at-wat force-pushed the refactor-errors branch 6 times, most recently from ac70fd5 to aa4ca69 Compare March 7, 2020 15:07
Wrap all errors to implement net.Error.
Caller of Read/Write can check err.(net.Error).Temporary() to determine
whether the error is fatal or not, as with raw net.UDPConn.

Split errInvalidPacketLength from errLengthMismatch.
errInvalidPacketLength is used for errors caused by incoming data,
which must be discarded, and errLengthMismatch is used for errors
due to the data generated by the library, which is a fatal internal
error.
@at-wat at-wat force-pushed the refactor-errors branch from aa4ca69 to 3ee958c Compare March 8, 2020 00:30
@at-wat
Copy link
Member Author

at-wat commented Mar 8, 2020

rebased

This was referenced Mar 8, 2020
@at-wat at-wat merged commit 9e8c93e into master Mar 9, 2020
@at-wat at-wat deleted the refactor-errors branch March 9, 2020 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants