Skip to main content

$warn

$warn(message?) -> undefined
Compact type signature<s?:u>
Browse categories

Source: FUME

Documentation

Emits a warning diagnostic entry and returns undefined.

Use $warn() for non-fatal conditions that should be surfaced to callers without throwing an error. This helper belongs to Diagnostics And Errors.

FUME coerces the message to a string, records it with code F5320, and attaches the current executionId to the diagnostic entry. During verbose evaluation the entry is collected under diagnostics.warning, and if the active policy allows logging, the configured logger receives the same message through its warn() method.

Examples

Emit a warning log entry

No file-backed example is used here because $warn() does not read the input; the important contract is its side effect and undefined return value.

This function has a side effect (emits a log entry). It returns undefined.

Input

null

Expression

$warn("Missing optional field: deductibleRemaining")

Result

undefined