Report

Reporting a failure where a fiber stops: logged at Error and handed to the Environment's ErrorReporters, so an app's error tracking sees it. An interruption is neither: it's how a run is removed.

import * as Report from "@wardic/dom/Report"

yield* Report.failure("wardic: an animation failed", cause)

Interfaces

DebugLog()

debugOf's log: called with an event and its annotations, and on when a Debug log is kept.

DebugLog(event, annotations?): void;

debugOf's log: called with an event and its annotations, and on when a Debug log is kept.

Parameters

event

string

annotations?

Record<string, unknown>

Returns

void

Properties

on
readonly on: boolean;

Whether a Debug log would be kept: when it's false, a call logs nothing.

Variables

debugKept

const debugKept: Effect.Effect<boolean>;

Whether a Debug log would be kept, as Effect's MinimumLogLevel says. Run it once (a runtime, a build) and keep the answer, not once a log.

Functions

debugOf()

function debugOf(runner, scope): DebugLog;

A lifecycle debug log for scope (wardic.projection, say): log(event, annotations?) logs scope: event at Debug, forked on runner, with the annotations. Whether a Debug log would be kept is read once, here (debugKept): when it wouldn't, on is false and log returns at once, forking nothing. A site that builds its annotations per element checks on first.

Parameters

runner
runFork

<A>(effect) => unknown

runSync

<A>(effect) => A

scope

string

Returns

DebugLog


failure()

function failure(message, cause): Effect<void>;

cause logged at Error as message, with the cause, and handed to the Environment's ErrorReporters. An interruption is neither: it's how a run is removed, by a retarget, an unmount or a dispose. Annotate the log by piping Effect.annotateLogs onto it.

Parameters

message

string

cause

Cause<unknown>

Returns

Effect<void>