Skip to content

Commit

Permalink
Fill in the 'error' variant
Browse files Browse the repository at this point in the history
Resolves #49
  • Loading branch information
lukewagner committed Sep 12, 2023
1 parent e01ac85 commit 5683e33
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions wit/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,42 @@ interface types {
other(string)
}

// TODO: perhaps better align with HTTP semantics?
// This type enumerates the different kinds of errors that may occur when
// initially returning a response.
// 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
// Note: the `http_request_error` case maps to an `ok` response with a 4xx
// `status-code`.
variant error {
invalid-url(string),
timeout-error(string),
protocol-error(string),
unexpected-error(string)
DNS-timeout,
DNS-error(string, u16),
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(u8, string),
HTTP-request-denied,
HTTP-response-incomplete,
HTTP-response-header-section-size(u32),
HTTP-response-header-size(string, u32),
HTTP-response-body-size(u32),
HTTP-response-trailer-section-size(u32),
HTTP-response-trailer-size(string, u32),
HTTP-response-transfer-coding(string),
HTTP-response-content-coding(string),
HTTP-response-timeout,
HTTP-upgrade-failed,
HTTP-protocol-error,
proxy-internal-response,
proxy-internal-error,
proxy-configuration-error,
proxy-loop-detected
}

// This following block defines the `fields` resource which corresponds to
Expand Down

0 comments on commit 5683e33

Please sign in to comment.