Explorer

http.error-text

description
The error code as text (the WASI name with -, and the message of internal_error)
type
Fn(error: @http.error-code) -> String
expression
fn(error$0) =>
  match $0 {
    #dns_timeout(_) =>
      "dns-timeout",
    #dns_error(_) =>
      "dns-error",
    #destination_not_found(_) =>
      "destination-not-found",
    #destination_unavailable(_) =>
      "destination-unavailable",
    #destination_ip_prohibited(_) =>
      "destination-ip-prohibited",
    #destination_ip_unroutable(_) =>
      "destination-ip-unroutable",
    #connection_refused(_) =>
      "connection-refused",
    #connection_terminated(_) =>
      "connection-terminated",
    #connection_timeout(_) =>
      "connection-timeout",
    #connection_read_timeout(_) =>
      "connection-read-timeout",
    #connection_write_timeout(_) =>
      "connection-write-timeout",
    #connection_limit_reached(_) =>
      "connection-limit-reached",
    #tls_protocol_error(_) =>
      "tls-protocol-error",
    #tls_certificate_error(_) =>
      "tls-certificate-error",
    #http_request_denied(_) =>
      "http-request-denied",
    #http_request_length_required(_) =>
      "http-request-length-required",
    #http_request_method_invalid(_) =>
      "http-request-method-invalid",
    #http_request_uri_invalid(_) =>
      "http-request-uri-invalid",
    #http_request_uri_too_long(_) =>
      "http-request-uri-too-long",
    #http_response_incomplete(_) =>
      "http-response-incomplete",
    #http_response_timeout(_) =>
      "http-response-timeout",
    #http_upgrade_failed(_) =>
      "http-upgrade-failed",
    #http_protocol_error(_) =>
      "http-protocol-error",
    #loop_detected(_) =>
      "loop-detected",
    #configuration_error(_) =>
      "configuration-error",
    #internal_error(message$1) =>
      match $1 {
        #some(text$2) =>
          @core.string-concat(left: "internal-error: ", right: $2),
        #none(_) =>
          "internal-error"
      }
  }
visibility
public
http.error-text (project http, branch main, snapshot FuOge41aUHwwPZkx2JW6O-Emair6Jc-D5YsZf5cx6b0)
id: KVC0WkT9-SNpa2oFF-kYKa4KmAJkqgA2Fjc_Ol6DuTM
content hash: eHhGvet35tzGOs3DX1oWyg7XntJyjTmb8R7k4m_gV4A