Skip to content
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

wasi-http: Migrate to more descriptive error variant #7434

Merged
merged 7 commits into from
Nov 11, 2023

Conversation

elliottt
Copy link
Member

@elliottt elliottt commented Nov 1, 2023

Integrate the more descriptive error variant present in WebAssembly/wasi-http#52. This PR attempts to port the existing errors we raise directly to the new variant.

Fixes #7248

@github-actions github-actions bot added the wasi Issues pertaining to WASI label Nov 1, 2023
@elliottt elliottt force-pushed the trevor/wasi-http-errors branch from 84c6b44 to 89f1876 Compare November 1, 2023 01:30
Comment on lines -119 to -128
// TODO: maybe anything that appears in the Result<_, E> position should impl
// Error? anyway, just use its Debug here:
.map_err(|e| anyhow!("{e:?}"))?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was preventing downcast::<Error>() in test cases.

@elliottt elliottt force-pushed the trevor/wasi-http-errors branch 7 times, most recently from f113348 to f088227 Compare November 7, 2023 21:10
@elliottt elliottt marked this pull request as ready for review November 7, 2023 21:47
@elliottt elliottt requested a review from a team as a code owner November 7, 2023 21:47
@elliottt elliottt requested review from fitzgen and removed request for a team November 7, 2023 21:47
@elliottt elliottt force-pushed the trevor/wasi-http-errors branch from 61bd17b to aebbe78 Compare November 7, 2023 23:35
@elliottt elliottt requested a review from pchickey November 7, 2023 23:39
@elliottt elliottt force-pushed the trevor/wasi-http-errors branch from aebbe78 to 7af92d0 Compare November 9, 2023 01:25
@elliottt
Copy link
Member Author

@pchickey this should be ready to go now. I also folded in the changes to URI construction in the outgoing handler that we discussed today.

@pchickey pchickey added this pull request to the merge queue Nov 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 10, 2023
@elliottt elliottt force-pushed the trevor/wasi-http-errors branch from 2724b1f to c1b0290 Compare November 10, 2023 21:12
@elliottt elliottt enabled auto-merge November 10, 2023 21:46
@elliottt elliottt added this pull request to the merge queue Nov 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 10, 2023
@elliottt elliottt added this pull request to the merge queue Nov 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 10, 2023
@elliottt elliottt force-pushed the trevor/wasi-http-errors branch from 69708fe to ebabc9f Compare November 11, 2023 00:19
@elliottt elliottt added this pull request to the merge queue Nov 11, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2023
@elliottt elliottt added this pull request to the merge queue Nov 11, 2023
Merged via the queue into bytecodealliance:main with commit 8b523e7 Nov 11, 2023
40 checks passed
@elliottt elliottt deleted the trevor/wasi-http-errors branch November 11, 2023 06:43
alexcrichton pushed a commit to alexcrichton/wasmtime that referenced this pull request Nov 12, 2023
…e#7434)

* Migrate to a more specific error-code variant in wasi-http

Co-authored-by: Pat Hickey <[email protected]>

* Optional fields, and align with upstream pr

* Update for upstream changes to the error-code variant

* Sync with the upstream implementation

* Missed updating an error for riscv64 and s390x

* More debuggable error

prtest:full

* Try to stabilize the test on windows

---------

Co-authored-by: Pat Hickey <[email protected]>
alexcrichton added a commit that referenced this pull request Nov 13, 2023
* Remove timezone interface from wasi-clocks (#7515)

* delete wasi-clocks timezone interface: import wit changes from WebAssembly/wasi-clocks#55

* remove other references to wasi:clocks/timezone in wits

* remove todo! implementation of clocks/timezone and add_to_linker funcs

* Move the `wasi:io/stream/error` resource into `wasi:io/error` (#7521)

* Move the `error` resource into `wasi:io/error`

* error.wit: update doc comments

* downstream fixes to streams.wit doc comments

* fix package name in error.wit

---------

Co-authored-by: Trevor Elliott <[email protected]>

* wasi-http: Make child fields immutable (#7524)

* Make child fields immutable

* Add `get_fields` and remove `FieldMapMutability`

Clean up the interface to immutable fields by adding a different
accessor.

* Clean up the diff

* wasi-http: Migrate to more descriptive error variant (#7434)

* Migrate to a more specific error-code variant in wasi-http

Co-authored-by: Pat Hickey <[email protected]>

* Optional fields, and align with upstream pr

* Update for upstream changes to the error-code variant

* Sync with the upstream implementation

* Missed updating an error for riscv64 and s390x

* More debuggable error

prtest:full

* Try to stabilize the test on windows

---------

Co-authored-by: Pat Hickey <[email protected]>

* Remove a debugging eprintln (#7528)

* Remove no-longer-necessary reactor world (#7516)

The `wasi:cli` WIT package now has a `reactor` world so the adapter can
use that instead of defining its own.

---------

Co-authored-by: Pat Hickey <[email protected]>
Co-authored-by: Trevor Elliott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support running wasm from a url
2 participants