Function wasi::http::types::http_error_code

source ·
pub fn http_error_code(err: &IoError) -> Option<ErrorCode>
Expand description

Attempts to extract a http-related error from the wasi:io error provided.

Stream operations which return wasi:io/stream/stream-error::last-operation-failed have a payload of type wasi:io/error/error with more information about the operation that failed. This payload can be passed through to this function to see if there’s http-related information about the error to return.

Note that this function is fallible because not all io-errors are http-related errors.