Skip to content

Fix array element codec errors falling back instead of propagating#167

Merged
SeanTAllen merged 1 commit intomainfrom
fix-array-element-codec-error-propagation
Mar 15, 2026
Merged

Fix array element codec errors falling back instead of propagating#167
SeanTAllen merged 1 commit intomainfrom
fix-array-element-codec-error-propagation

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

Array element codec errors in CodecRegistry.decode() were caught by the same try/else that handles structural parsing errors, causing them to silently fall back to String/RawBytes instead of propagating to the caller. A corrupt int4 value inside an int4[] would quietly become a RawBytes or String instead of erroring.

Split array decoding into two phases: structural parsing (_parse_binary_array/_parse_text_array) where errors fall back, and element decoding (_decode_array_elements) where errors propagate. This matches the behavior scalar codecs already have.

Closes #158

@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Mar 15, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Mar 15, 2026
@SeanTAllen SeanTAllen removed the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Mar 15, 2026
Array element codec errors were caught by the same try/else that
handles structural parsing errors, causing them to silently fall back
to String/RawBytes instead of propagating. Split array decoding into
structural parsing (errors fall back) and element decoding (errors
propagate).

Closes #158
@SeanTAllen SeanTAllen force-pushed the fix-array-element-codec-error-propagation branch from 945c237 to e0e9852 Compare March 15, 2026 20:56
@SeanTAllen SeanTAllen merged commit 6a6dcd3 into main Mar 15, 2026
3 checks passed
@SeanTAllen SeanTAllen deleted the fix-array-element-codec-error-propagation branch March 15, 2026 20:56
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Mar 15, 2026
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.

Array element codec errors fall back instead of propagating

2 participants