error: make public errors structured and fatal-only#134
Conversation
|
126 merged. this can be rebased |
4b5d3ec to
1706bdd
Compare
|
@zRedShift what's the point of this PR? Feels like we're handling empty records in like 2 places in the code path already. |
|
@algesten the intent here isn’t to handle parsed empty records. this is before we have a record at all: a datagram that only contains an incomplete DTLS record header or body currently bubbles up as ParseIncomplete from handle_packet. the PR makes that look like normal UDP loss/truncation and drops it without turning it into a connection-level error. |
|
@zRedShift ok, but what about what we said in Discord about maybe not having ParseIncomplete as an error at all? |
|
@algesten i was a bit hesitant to take that plunge wholesale since it might become a big pr, but i agree this pr is too narrow and doesn’t buy us much. how about i rework it into a proper implementation of that idea and we’ll see from there? |
1706bdd to
2bc19e3
Compare
2bc19e3 to
9ee8e62
Compare
Draft follow-up to #126.
This keeps transient parser failures internal and reshapes the public
ErrorAPI so public errors represent connection-fatal outcomes rather than recoverable UDP/parser noise.Changes:
ParseIncomplete,ParseError, andTooManyRecordsfromError;Stringto typed errors;Stringpayloads;Errorsize from 32 bytes to 16 bytes on this target.Validation:
cargo fmt --checkgit diff --checkcargo test --all-targets --features rcgencargo clippy --all-targets --features rcgen -- -D warningscargo test --no-default-features --features rust-cryptocargo clippy --no-default-features --features rust-crypto -- -D warningscargo test --doc --features rcgen