Stream: git-wasmtime

Topic: wasmtime / PR #7534 wasi-http: Implement http-error-code,...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 01:01):

elliottt opened PR #7534 from elliottt:trevor/error-code-follow-up to bytecodealliance:main:

Implement the body of http-error-code, and add a test that shows its use when writing too much. This functionality was missing from #7434.

Additionally, add some functions in wasi-http for converting from hyper::Error and http::Error to the new ErrorCode variant. These functions log the error received as a warning, and return the translated error to the guest.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 01:01):

elliottt requested fitzgen for a review on PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 01:01):

elliottt requested wasmtime-core-reviewers for a review on PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 01:02):

elliottt requested alexcrichton for a review on PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 01:02):

elliottt requested pchickey for a review on PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 01:21):

elliottt updated PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 15:43):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 15:43):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 15:43):

alexcrichton created PR review comment:

I realize that this matches what I was talking about yesterday, where if an error is dropped on the floor it's always at least logged, but I will also say that there's quite a lot of logging going on here. In theory almost all error context should be made available to end users, but it seems like almost all errors are being dropped and canonicalized in bland error codes.

There's not really anything that can be done about that in this PR specifically, but it might be something good to keep in mind for future iterations of wasi-http. One possible example might be something like a "last error as debug string" API or something like that. Or alternatively using wasi:io/error.{error} for all http APIs and then having an optional "pull out the http-specific error kind from each error" API sort of like filesystems. Too late to do this for preview2 but perhaps later.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 18:08):

elliottt updated PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 18:33):

elliottt updated PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 18:39):

elliottt submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 18:39):

elliottt created PR review comment:

This was going to be a bit noisy, so I've reworked it so that we only log on a path where there's not clear translation back to a wasi-http error (the fall-through cases). Looking more towards the future, I wonder if it would be better to return a wasi:io/error/error instead of a wasi:http/types/error-code. @pchickey and I started working on this last week, but held off on making this change as it was not as easy as swapping out uses of error-code.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 18:58):

elliottt updated PR #7534.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 14 2023 at 20:22):

elliottt merged PR #7534.


Last updated: Dec 23 2024 at 12:05 UTC