Docs · API reference · Verso.Execution

BackgroundFaultSink Class#

Holds failures from work a notebook started but did not wait for, until there is a cell to report them against.

One sink belongs to one notebook. Faults are attributed to the notebook that was running when they surfaced, which is not always the one that caused them, so the reported text says where they came from.

Nothing here is translated. Every line it writes exists only because something went wrong, and what reaches the reader is mostly the exception's own text, which arrives in English however the interface is set. Wrapping that in a translated sentence would make an issue report harder to match against the code that produced it without making the fault any easier to understand.

public sealed class BackgroundFaultSink

Inheritance System.Object → BackgroundFaultSink

Properties#

IsExecuting Property#

Whether this notebook is inside a cell right now.

public bool IsExecuting { get; }

Property Value#

System.Boolean

Methods#

BeginExecution() Method#

Marks this notebook as running a cell for the lifetime of the returned scope. Counted rather than flagged, because a cell can run while another is still finishing.

public System.IDisposable BeginExecution();

Returns#

System.IDisposable

Drain() Method#

Takes everything recorded so far, leaving the queue empty. Returns an empty list when nothing has gone wrong, which is the usual case.

public System.Collections.Generic.IReadOnlyList<Verso.Abstractions.CellOutput> Drain();

Returns#

System.Collections.Generic.IReadOnlyList<CellOutput>

Record(string, Exception) Method#

Records a fault to be reported with this notebook's next cell result.

public void Record(string kind, System.Exception? exception);

Parameters#

kind System.String

exception System.Exception