Debian Codegraph @

vendor/wit-component/tests/interfaces/wasi-http/deps/io/error.wit

raw
1 package wasi:[email protected];
2
3
4 interface error {
5 /// A resource which represents some error information.
6 ///
7 /// The only method provided by this resource is `to-debug-string`,
8 /// which provides some human-readable information about the error.
9 ///
10 /// In the `wasi:io` package, this resource is returned through the
11 /// `wasi:io/streams/stream-error` type.
12 ///
13 /// To provide more specific error information, other interfaces may
14 /// provide functions to further "downcast" this error into more specific
15 /// error information. For example, `error`s returned in streams derived
16 /// from filesystem types to be described using the filesystem's own
17 /// error-code type, using the function
18 /// `wasi:filesystem/types/filesystem-error-code`, which takes a parameter
19 /// `borrow<error>` and returns
20 /// `option<wasi:filesystem/types/error-code>`.
21 ///
22 /// The set of functions which can "downcast" an `error` into a more
23 /// concrete type is open.
24 resource error {
25 /// Returns a string that is suitable to assist humans in debugging
26 /// this error.
27 ///
28 /// WARNING: The returned string should not be consumed mechanically!
29 /// It may change across platforms, hosts, or other implementation
30 /// details. Parsing this string is a major platform-compatibility
31 /// hazard.
32 to-debug-string: func() -> string;
33 }
34 }