Conversation
… for clarity - CombinedStream.Length, Position.set, Seek, SetLength, Write, WriteByte now raise NotSupportedException instead of bare Exception via failwith. This is the correct exception type for unsupported stream operations per .NET guidelines, and fixes code that catches NotSupportedException not catching these. - Fix typo in Length error message: 'cannot be determine' → 'cannot be determined' - Rename shadowed inner isText helper to isMimeTypeText for code clarity; add explanatory comment about the semicolon-split logic. - Update tests to expect NotSupportedException instead of Exception. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
approved these changes
Mar 14, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.
Task 5 — Coding Improvements: Http.fs code quality
Two targeted, low-risk improvements to
Http.fs:1.
CombinedStream:failwith→NotSupportedExceptionCombinedStreamis a read-only, non-seekable stream wrapper. Its unsupported operations (Write,WriteByte,Seek,SetLength,Position.set) previously threw bareSystem.Exceptionviafailwith. According to .NET stream guidelines, these operations must throwNotSupportedException.Why this matters: any .NET code that does
try ... with :? NotSupportedException(e.g.,Stream.CopyToAsync, BCL helpers, third-party libraries) would not catch these bare exceptions. Returning the correct exception type makes the stream behave as a well-formed .NET stream.Also fixes a typo in the error message:
"cannot be determine"→"cannot be determined".2. Inner
isTextrename →isMimeTypeTextThe
isTextouter function contained an identically-named inner function, creating a confusing shadow. The inner function has been renamedisMimeTypeTextto clarify the distinction. An explanatory comment was added to make the semicolon-split purpose explicit.No behavioural change — the logic is identical.
Changes
src/FSharp.Data.Http/Http.fs:CombinedStreamraisesNotSupportedException; innerisTextrenamedtests/FSharp.Data.Core.Tests/Http.fs: two tests updated to expectNotSupportedExceptioninstead ofExceptionRELEASE_NOTES.md: version bumped to 8.1.1Test Status