MPTF/HTML Error codes

From Web and TV IG

Network error codes in HTML

Requirements

Web applications for commercial services need to report back to the service provider on the causes of errors that result in disruption of service to the users. This information is required for operational purposes: monitoring service performance, responding to customer service calls and for improving service performance.

The existing MediaError interface exposes very limited error information. In particular in the case of network errors more specific error reporting is required.

This proposal is responsive to LC bug #12399.

Proposal

The following addresses a small subset of the possible network errors, focussing on those errors which are intrinsic to IP networking and so common to all implementations. These are reported using a new error code attribute: the top-level code attribute still takes the value MEDIA_ERR_NETWORK for backwards compatibility with scripts which do not require the more precise error information.

interface MediaError {
  const unsigned short MEDIA_ERR_ABORTED = 1;
  const unsigned short MEDIA_ERR_NETWORK = 2;
  const unsigned short MEDIA_ERR_DECODE = 3;
  const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
  readonly attribute unsigned short code;

  const unsigned short MEDIA_ERR_NETWORK_DNS = 1;
  const unsigned short MEDIA_ERR_NETWORK_DNS_NO_RECORD_FOUND = 2;

  const unsigned short MEDIA_ERR_NETWORK_TCP_NO_ROUTE = 3;
  const unsigned short MEDIA_ERR_NETWORK_TCP_TIMEOUT = 4;
  const unsigned short MEDIA_ERR_NETWORK_TCP_REFUSED = 5;
  const unsigned short MEDIA_ERR_NETWORK_TCP_RESET = 6;

  const unsigned short MEDIA_ERR_NETWORK_TLS_CERT_UNTRUSTED = 7;
  const unsigned short MEDIA_ERR_NETWORK_TLS_CERT_EXPIRED = 8;
  const unsigned short MEDIA_ERR_NETWORK_TLS_NO_CIPHER = 9;
  const unsigned short MEDIA_ERR_NETWORK_TLS_HANDSHAKE = 10;

  const unsigned short MEDIA_ERR_NETWORK_HTTP_TIMEOUT = 11;
  const unsigned short MEDIA_ERR_NETWORK_HTTP_REDIRECTS = 12;
  const unsigned short MEDIA_ERR_NETWORK_HTTP_RESPONSE = 13;
  const unsigned short MEDIA_ERR_NETWORK_HTTP_ERROR = 14;

  const unsigned short MEDIA_ERR_NETWORK_RTSP_TIMEOUT = 15;
  const unsigned short MEDIA_ERR_NETWORK_RTSP_REDIRECTS = 16;
  const unsigned short MEDIA_ERR_NETWORK_RTSP_RESPONSE = 17;
  const unsigned short MEDIA_ERR_NETWORK_RTSP_ERROR = 18;
  readonly attribute unsigned short networkcode;
  readonly attribute unsigned short httpcode;
  readonly attribute unsigned short rtspcode;
};


The networkcode attribute may provide additional information about the network error in the case that the code attribute is MEDIA_ERR_NETWORK.

The value MEDIA_ERR_NETWORK_DNS means that the network error is due to a DNS failure (either the DNS server is not known, cannot be contacted or no response is received).

The value MEDIA_ERR_NETWORK_DNS_NO_RECORD_FOUND means that there is no suitable DNS record found.

(either the DNS server is not known, cannot be contacted, no response is received before timeout or no suitable DNS records are found).

The value MEDIA_ERR_NETWORK_TCP_NO_ROUTE means that a TCP connection could not be established because there was no IP route to the host.

The value MEDIA_ERR_NETWORK_TCP_TIMEOUT means that a TCP connection could not be established because the connection timed out during establishment.

The value MEDIA_ERR_NETWORK_TCP_REFUSED means that a TCP connection could not be established because the establishment was refused by the remote host.

The value MEDIA_ERR_NETWORK_TCP_RESET means that an established TCP connection was reset by the remote host.

The value MEDIA_ERR_NETWORK_TLS_CERT_UNTRUSTED means that the certificate provided by the remote host for TLS authentication is not trusted.

The value MEDIA_ERR_NETWORK_TLS_CERT_EXPIRED means that the certificate provided by the remote host for TLS authentication was expired.

The value MEDIA_ERR_NETWORK_TLS_NO_CIPHER means that no TLS cipher could be agreed between the hosts.

The value MEDIA_ERR_NETWORK_TLS_HANDSHAKE means that the TLS handshake failed for another reason.

The value MEDIA_ERR_NETWORK_HTTP_TIMEOUT means that no response was received from the HTTP server within a time out.

The value MEDIA_ERR_NETWORK_HTTP_REDIRECTS means that the maximum number of redirects for a request was exceeded.

The value MEDIA_ERR_NETWORK_HTTP_RESPONSE means that a malformed HTTP response was received.

The value MEDIA_ERR_NETWORK_HTTP_ERROR means that an HTTP error response was received. In this case the httpcode attribute shall provide the HTTP response code.

The value MEDIA_ERR_NETWORK_RTSP_TIMEOUT means that no response was received from the RTSP server within a time out.

The value MEDIA_ERR_NETWORK_RTSP_REDIRECTS means that the maximum number of redirects for a request was exceeded.

The value MEDIA_ERR_NETWORK_RTSP_RESPONSE means that a malformed RTSP response was received.

The value MEDIA_ERR_NETWORK_RTSP_ERROR means that an RTSP error response was received. In this case the rtspcode attribute shall provide the RTSP response code.