Skip to content

Correctly report numeric overflow and clarify error semantics#100

Merged
syyyr merged 1 commit into
masterfrom
fix-decimal-overflow-error-reporting
Feb 6, 2026
Merged

Correctly report numeric overflow and clarify error semantics#100
syyyr merged 1 commit into
masterfrom
fix-decimal-overflow-error-reporting

Conversation

@j4r0u53k
Copy link
Copy Markdown
Contributor

@j4r0u53k j4r0u53k commented Feb 6, 2026

Fixes a bug where ReadErrorReason::NotEnoughPrecision was never constructed.

NotEnoughPrecision renamed to NumericValueOverflow for clearer semantics.

Replaced magic decimal threshold with equivalent hex literal (0x80000000000000) for better readability.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 6, 2026

Code coverage report for cd20296

Coverage difference

⚠️ There are new lines with missing coverage.

Filename Stmts Miss Cover Missing
TOTAL 0 0 +100.00%

Overall coverage

Click to expand
Filename Stmts Miss Cover Missing
src/bin/cp2cp.rs 117 33 71.79% 66, 105-106, 126-132, 145, 149-150, 159-161, 170-172, 181-183, 187, 199-208, 212-213
src/cpon.rs 524 79 84.92% 35-37, 41, 45, 52, 57, 62, 75, 79, 92, 99-106, 125-146, 158-197, 300-301, 329-330, 336, 358, 371-375, 405, 421, 448-453, 490, 492-496, 511, 637
src/datetime.rs 166 48 71.08% 90-94, 102, 108-113, 117-119, 152, 163-164, 179, 184-235
src/jaq.rs 180 173 3.89% 11-230, 240, 244-280
src/decimal.rs 215 2 99.07% 132-135
src/lib.rs 9 0 100.00%
src/reader.rs 64 5 92.19% 21-23, 66, 84
src/chainpack.rs 629 13 97.93% 88, 264-276, 281
src/rpcvalue.rs 688 162 76.45% 71, 73-77, 79, 81-82, 85-100, 127-129, 175-177, 217-219, 258-263, 414-426, 434, 451, 458-463, 481, 488-513, 521, 533, 560, 577, 594, 604, 614, 624, 644, 654, 664, 674, 684, 698-727, 927-946, 985-987, 991, 1001, 1009-1020, 1024, 1027-1035, 1039, 1042-1047, 1051, 1063, 1075, 1081, 1087, 1091-1107, 1155-1163
src/textrdwr.rs 236 29 87.71% 47-72, 131, 134, 144, 147, 159, 167-169, 212, 228, 243, 253, 270, 312
src/util.rs 81 40 50.62% 25, 32-72
src/writer.rs 18 0 100.00%
src/serde.rs 52 27 48.08% 21-64, 74-82
src/json.rs 417 25 94.00% 221, 257, 265, 278, 319-334, 349, 394-396, 408, 519
src/metamap.rs 106 33 68.87% 44-53, 69-74, 90-97, 128-145
src/serde/ser.rs 578 329 43.08% 13-15, 50-52, 66-80, 86-88, 98-115, 138, 142-156, 162-173, 227-378, 387-438, 444-583, 608-633, 675, 780
src/serde/de.rs 387 110 71.58% 30, 36-37, 50, 75, 86-91, 104, 106-108, 119-124, 141-144, 148-153, 162, 179, 183-211, 254-256, 281-302, 315, 348-352, 371-401, 414-416, 425-431, 454-456, 487-489
TOTAL 4467 1108 75.20%

HTML reports

You can use GitHub CLI to download HTML coverage reports and open them automatically using this command:

(cd "$(mktemp -d)" && gh run -R silicon-heaven/libshvproto-rs download -n libshvproto-cov-html-cd20296db96f6b7fba2e83bcd51188ac587c943a && ls -1 | xargs -n1 xdg-open)

You can download the HTML reports manually here.

@j4r0u53k j4r0u53k requested a review from syyyr February 6, 2026 14:05
Fixes a bug where ReadErrorReason::NotEnoughPrecision was never constructed.

NotEnoughPrecision renamed to NumericValueOverflow for clearer semantics.

Replaced magic decimal threshold with equivalent hex literal (0x80000000000000)
for better readability.
@j4r0u53k j4r0u53k force-pushed the fix-decimal-overflow-error-reporting branch from f42e7a7 to cd20296 Compare February 6, 2026 14:10
@syyyr syyyr merged commit f739548 into master Feb 6, 2026
9 checks passed
@syyyr syyyr deleted the fix-decimal-overflow-error-reporting branch February 6, 2026 14:17
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