diff --git a/proxy.md b/proxy.md index 4194b5e..cef8d2a 100644 --- a/proxy.md +++ b/proxy.md @@ -644,6 +644,9 @@ their headers, trailers, and bodies.
#### `type output-stream` [`output-stream`](#output_stream)+#### `type stream-error` +[`error`](#error) +
#### `type pollable` [`pollable`](#pollable)
@@ -670,16 +673,76 @@ their headers, trailers, and bodies.
HTTPSother: stringvariant errorTODO: 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-payloadDefines the case payload type for DNS-error above:
record TLS-alert-received-payloadDefines the case payload type for TLS-alert-received above:
alert-id: option<u8>alert-message: option<string>record field-size-payloadDefines the case payload type for HTTP-response-{header,trailer}-size above:
field-name: option<string>field-size: option<u32>variant error-codeThese cases are inspired by 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: stringtimeout-error: stringprotocol-error: stringunexpected-error: stringDNS-timeoutDNS-error: DNS-error-payloaddestination-not-founddestination-unavailabledestination-IP-prohibiteddestination-IP-unroutableconnection-refusedconnection-terminatedconnection-timeoutconnection-read-timeoutconnection-write-timeoutconnection-limit-reachedTLS-protocol-errorTLS-certificate-errorTLS-alert-received: TLS-alert-received-payloadHTTP-request-deniedHTTP-request-length-requiredHTTP-request-body-size: option<u64>HTTP-request-method-invalidHTTP-request-URI-invalidHTTP-request-URI-too-longHTTP-request-header-section-size: option<u32>HTTP-request-header-size: option<field-size-payload>HTTP-request-trailer-section-size: option<u32>HTTP-request-trailer-size: field-size-payloadHTTP-response-incompleteHTTP-response-header-section-size: option<u32>HTTP-response-header-size: field-size-payloadHTTP-response-body-size: option<u64>HTTP-response-trailer-section-size: option<u32>HTTP-response-trailer-size: field-size-payloadHTTP-response-transfer-coding: option<string>HTTP-response-content-coding: option<string>HTTP-response-timeoutHTTP-upgrade-failedHTTP-protocol-errorloop-detectedconfiguration-errorinternal-error: option<string>This is a catch-all error for anything that doesn't fit cleanly into a +more specific case. It also includes an optional string for an +unstructured description of the error. Users should not depend on the +string for diagnosing errors, as it's not required to be consistent +between implementations. +
variant header-errorThis type enumerates the different kinds of errors that may occur when @@ -728,6 +791,23 @@ so they are provided as a list of bytes.
resource future-incoming-responsehttp-error-code: funcAttempts 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: funcConstruct 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: funcReturns the status code from the incoming response.
@@ -1210,7 +1290,7 @@ trailers were present in the body.trailers>>, error>>trailers>>, error-code>>[constructor]outgoing-response: funcConstruct an outgoing-response, with a default status-code of 200.
@@ -1331,7 +1411,7 @@ but those will be reported by the incoming-body
>, Return values
-
incoming-responseerror>>>
+
incoming-response>, error-code>>>This interface defines a handler of outgoing HTTP Requests. It should be @@ -1347,8 +1427,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>