Wrap short-packet errors with packet context
Description
-
wrap all code paths that return errPacketTooShort so the error message now includes the packet or header type while keeping errors.Is compatibility
-
add helper utilities (packetTooShortError, packetNameFromHeader) to centralize naming logic. packetNameFromHeader can be used later to fine-tune other errors with their origin
-
update existing unmarshallers and size checks to use the helper, improving observability across RTCP packet types
-
extend the test suite to cover the new behavior, including unit tests for the helper and a regression test on the existing invalid-header scenario
Reference issue
#Implements improvement pion/rtcp#208
Codecov Report
:x: Patch coverage is 59.79381% with 39 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 77.03%. Comparing base (99b388f) to head (bd3c40c).
:x: Your patch check has failed because the patch coverage (59.79%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## master #211 +/- ##
==========================================
- Coverage 77.07% 77.03% -0.04%
==========================================
Files 22 23 +1
Lines 2569 2086 -483
==========================================
- Hits 1980 1607 -373
+ Misses 493 381 -112
- Partials 96 98 +2
| Flag | Coverage Δ | |
|---|---|---|
| go | 77.03% <59.79%> (-0.04%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.