-
Notifications
You must be signed in to change notification settings - Fork 308
feat(http): size-exceeded error variant #891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,20 @@ interface types { | |
| /// This error indicates that the operation on the `fields` was not | ||
| /// permitted because the fields are immutable. | ||
| immutable, | ||
|
|
||
| /// This error indicates that the operation would exceed an | ||
| /// implementation-defined limit on field sizes. This may apply to | ||
| /// an individual `field-value`, a single `field-name` plus all its | ||
| /// values, or the total aggregate size of all fields. | ||
| size-exceeded, | ||
|
|
||
| /// This is a catch-all error for anything that doesn't fit cleanly into a | ||
| /// more specific case. Implementations can use this to extend the error | ||
| /// type without breaking existing code. It also includes an optional | ||
| /// string for an unstructured description of the error. Users should not | ||
| /// depend on the string for diagnosing errors, as it's not required to be | ||
| /// consistent between implementations. | ||
| other(option<string>), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used I could argue for the description being required, but we should aim to keep these two consistent. |
||
| } | ||
|
|
||
| /// This type enumerates the different kinds of errors that may occur when | ||
|
|
@@ -128,6 +142,14 @@ interface types { | |
| /// Indicates that the operation on the `request-options` was not permitted | ||
| /// because it is immutable. | ||
| immutable, | ||
|
|
||
| /// This is a catch-all error for anything that doesn't fit cleanly into a | ||
| /// more specific case. Implementations can use this to extend the error | ||
| /// type without breaking existing code. It also includes an optional | ||
| /// string for an unstructured description of the error. Users should not | ||
| /// depend on the string for diagnosing errors, as it's not required to be | ||
| /// consistent between implementations. | ||
| other(option<string>), | ||
| } | ||
|
|
||
| /// Field names are always strings. | ||
|
|
@@ -158,6 +180,10 @@ interface types { | |
| /// original casing used to construct or mutate the `fields` resource. The `fields` | ||
| /// resource should use that original casing when serializing the fields for | ||
| /// transport or when returning them from a method. | ||
| /// | ||
| /// Implementations may impose limits on individual field values and on total | ||
| /// aggregate field section size. Operations that would exceed these limits | ||
| /// fail with `header-error.size-exceeded` | ||
| @since(version = 0.3.0-rc-2026-02-09) | ||
| resource fields { | ||
|
|
||
|
|
@@ -180,7 +206,8 @@ interface types { | |
| /// well-formed, so they are represented as a raw list of bytes. | ||
| /// | ||
| /// An error result will be returned if any header or value was | ||
| /// syntactically invalid, or if a header was forbidden. | ||
| /// syntactically invalid, if a header was forbidden, or if the | ||
| /// entries would exceed an implementation size limit. | ||
| from-list: static func( | ||
| entries: list<tuple<field-name,field-value>> | ||
| ) -> result<fields, header-error>; | ||
|
|
@@ -199,6 +226,9 @@ interface types { | |
| /// name, if they have been set. | ||
| /// | ||
| /// Fails with `header-error.immutable` if the `fields` are immutable. | ||
| /// | ||
| /// Fails with `header-error.size-exceeded` if the name or values would | ||
| /// exceed an implementation-defined size limit. | ||
| set: func(name: field-name, value: list<field-value>) -> result<_, header-error>; | ||
|
|
||
| /// Delete all values for a name. Does nothing if no values for the name | ||
|
|
@@ -219,6 +249,9 @@ interface types { | |
| /// values for that name. | ||
| /// | ||
| /// Fails with `header-error.immutable` if the `fields` are immutable. | ||
| /// | ||
| /// Fails with `header-error.size-exceeded` if the value would exceed | ||
| /// an implementation-defined size limit. | ||
| append: func(name: field-name, value: field-value) -> result<_, header-error>; | ||
|
|
||
| /// Retrieve the full set of names and values in the Fields. Like the | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these unrelated changes?