Skip to content

Commit 0c3a7dd

Browse files
author
Pat Hickey
committed
the wasi:io/streams/error is canonically wasi:io/error/error now
1 parent 7dc1e7e commit 0c3a7dd

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

wit/types.wit

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
/// their headers, trailers, and bodies.
44
interface types {
55
use wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10.{duration};
6-
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream, output-stream, error as stream-error};
6+
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream, output-stream};
7+
use wasi:io/error@0.2.0-rc-2023-11-10.{error as io-error};
78
use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
89

910
/// This type corresponds to HTTP standard Methods.
@@ -94,17 +95,18 @@ interface types {
9495
field-size: option<u32>
9596
}
9697

97-
/// Attempts to extract a http-related `error` from the stream `error`
98+
/// Attempts to extract a http-related `error` from the wasi:io `error`
9899
/// provided.
99100
///
100-
/// Stream operations which return `stream-error::last-operation-failed` have
101-
/// a payload with more information about the operation that failed. This
102-
/// payload can be passed through to this function to see if there's
103-
/// http-related information about the error to return.
101+
/// Stream operations which return
102+
/// `wasi:io/stream/stream-error::last-operation-failed` have a payload of
103+
/// type `wasi:io/error/error` with more information about the operation
104+
/// that failed. This payload can be passed through to this function to see
105+
/// if there's http-related information about the error to return.
104106
///
105-
/// Note that this function is fallible because not all stream-related errors
106-
/// are http-related errors.
107-
http-error-code: func(err: borrow<stream-error>) -> option<error-code>;
107+
/// Note that this function is fallible because not all io-errors are
108+
/// http-related errors.
109+
http-error-code: func(err: borrow<io-error>) -> option<error-code>;
108110

109111
/// This type enumerates the different kinds of errors that may occur when
110112
/// setting or appending to a `fields` resource.

0 commit comments

Comments
 (0)