From 99b5155c556535f7d7503c5d5e0493b4b87c0af1 Mon Sep 17 00:00:00 2001
From: Trevor Elliott
+#### `type stream-error` +[`error`](#error) +
#### `type pollable` [`pollable`](#pollable)
@@ -670,16 +673,71 @@ their headers, trailers, and bodies.
HTTPS
other
: string
variant error
TODO: perhaps better align with HTTP semantics? -This type enumerates the different kinds of errors that may occur when -initially returning a response.
+record DNS-error-payload
Defines the case payload type for DNS-error
above:
record TLS-alert-received-payload
Defines the case payload type for TLS-alert-received
above:
alert-ID
: option<u8
>alert-message
: option<string
>record HTTP-request-error-payload
Defines the case payload type for HTTP-request-error
above:
status-code
: option<u16
>status-phrase
: option<string
>record field-size-payload
Defines the case payload type for HTTP-response-{header,trailer}-size
above:
field-name
: option<string
>field-size
: option<u32
>variant error-code
The cases of this variant correspond to the IANA HTTP Proxy Error Types: +https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types
invalid-url
: string
timeout-error
: string
protocol-error
: string
unexpected-error
: string
DNS-timeout
DNS-error
: DNS-error-payload
destination-not-found
destination-unavailable
destination-IP-prohibited
destination-IP-unroutable
connection-refused
connection-terminated
connection-timeout
connection-read-timeout
connection-write-timeout
connection-limit-reached
TLS-protocol-error
TLS-certificate-error
TLS-alert-received
: TLS-alert-received-payload
HTTP-request-error
: HTTP-request-error-payload
HTTP-request-denied
HTTP-response-incomplete
HTTP-response-header-section-size
: option<u32
>HTTP-response-header-size
: field-size-payload
HTTP-response-body-size
: option<u32
>HTTP-response-trailer-section-size
: option<u32
>HTTP-response-trailer-size
: field-size-payload
HTTP-response-transfer-coding
: option<string
>HTTP-response-content-coding
: option<string
>HTTP-response-timeout
HTTP-upgrade-failed
HTTP-protocol-error
proxy-internal-response
proxy-internal-error
proxy-configuration-error
proxy-loop-detected
variant header-error
This type enumerates the different kinds of errors that may occur when @@ -728,6 +786,23 @@ so they are provided as a list of bytes.
resource future-incoming-response
http-error-code: func
Attempts to extract a http-related error
from the stream error
+provided.
Stream operations which return stream-error::last-operation-failed
have
+a payload 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 stream-related errors +are http-related errors.
+err
: borrow<stream-error
>error-code
>[constructor]fields: func
Construct an empty HTTP Fields.
param
: own<response-outparam
>response
: result<own<outgoing-response
>, error
>response
: result<own<outgoing-response
>, error-code
>[method]incoming-response.status: func
Returns the status code from the incoming response.
@@ -1198,7 +1273,7 @@ trailers were present in the body.trailers
>>, error
>>trailers
>>, error-code
>>[constructor]outgoing-response: func
Construct an outgoing-response
.
incoming-body
Return values
-- option<result<result<own<
incoming-response
>, error
>>>
+incoming-response
>, error-code
>>>This interface defines a handler of outgoing HTTP Requests. It should be @@ -1330,8 +1405,8 @@ imported by components which wish to make HTTP Requests.
#### `type future-incoming-response` [`future-incoming-response`](#future_incoming_response)-#### `type error` -[`error`](#error) +#### `type error-code` +[`error-code`](#error_code)
----
future-incoming-response
Return values
-- result<own<
future-incoming-response
>, error
>
+future-incoming-response
>, error-code
>