Skip to content

Function: httpStatusToSvtaErrorCode() ​

ts
function httpStatusToSvtaErrorCode(status): number;

Defined in: httpStatusToSvtaErrorCode.ts:20

Embed an HTTP response status code into the SVTA Network error category, per the external code embedding rule of SVTA2070. HTTP 404 becomes 3404.

Values outside the valid HTTP status range (integers 100-599) return the unknown network error code (3000) rather than throwing, so error reporting paths cannot fail.

Parameters ​

status ​

number

An HTTP response status code (100-599).

Returns ​

number

The SVTA network error code embedding the status.

Example ​

ts
const code = httpStatusToSvtaErrorCode(404)

assert(code === 3404)

A Streaming Video Technology Alliance project.