Skip to content

TypeScript API / laikacms/json-api / warningsFromMeta

Function: warningsFromMeta() ​

ts
function warningsFromMeta(meta): readonly LaikaError<ErrorCode, number>[];

Extract upstream JSON:API meta.warnings from a parsed response body and convert each into a typed LaikaError. Used by JSON:API proxy backends to re-emit upstream warnings as local recoverableErrors so warnings flow end-to-end through a proxy chain instead of dying at every hop.

Tolerant: unrecognized shapes return [] rather than throw — a proxy should never make its caller's stream blow up just because the upstream meta was malformed.

Parameters ​

ParameterType
metaunknown

Returns ​

readonly LaikaError<ErrorCode, number>[]

Released under the MIT License.