# Reason `'internal-error'`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` and `tables/problems.json` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

A member of [`Reason`](../api/Reason.md) · stable · since 2.0.0

applying a state write, recorded or look-only, through `session` or a `tx`, failed inside the runtime before its commit point; that write, or the transaction holding it, rolled back and lists 'sync-failed' in `problems` (spec section 6.4).

## Where the declaration names it

- [`Assembly.attach`](../api/Assembly.attach.md): Errors: a refusal resolves (`attached: false`), never rejects, and so does an internal failure ('rolled-back', 'internal-error'; spec section 6.4); invalid input rejects HoloInputError.
- [`Outcome`](../api/Outcome.md): - 'rolled-back': it ran, then was undone (reason 'timeout', 'enlisted-failed' or 'internal-error').
- [`Session.redo`](../api/Session.redo.md): As `undo`: in the write queue; ends an open group at its call; always moves the history pointer, except on 'rolled-back' / 'internal-error'; 'committed', or 'refused' with reason 'empty'.
- [`Session.transaction`](../api/Session.transaction.md): Outcome: resolves at the commit point ('committed', with `value`), or with 'rolled-back', 'superseded', 'refused' or 'dry-run'; an internal failure applying a staged write rolls it back with reason 'internal-error' (spec section 6.4).
- [`Session.undo`](../api/Session.undo.md): The one exception: when applying it fails inside the runtime, it resolves 'rolled-back' with reason 'internal-error' and the pointer and the step stay where they were (spec section 6.4).
- [`Writer`](../api/Writer.md): An autocommit one undoes only its own uncommitted effects, so a write that committed while it loaded keeps its state, and resolves 'rolled-back' with reason 'internal-error'; one through a `tx` rolls the transaction holding it back to its opening state (spec section 6.4).
- [`Writer.applyPatch`](../api/Writer.applyPatch.md): 'rolled-back' with reason 'internal-error' when applying it failed inside the runtime; through a `tx`, it then rejects AbortError and the transaction resolves 'rolled-back' (spec section 6.4).
- [`Writer.select`](../api/Writer.select.md): 'rolled-back' with reason 'internal-error' when applying it failed inside the runtime (through a `tx`, it then rejects AbortError and the transaction resolves 'rolled-back'; spec section 6.4).
- [`Writer.setSceneModel`](../api/Writer.setSceneModel.md): Outcome: 'committed' at its commit point, after its loads; through a `tx`, 'staged' once loaded; 'rolled-back' with reason 'internal-error' when applying it failed inside the runtime (through a `tx`, it then rejects AbortError and the transaction resolves 'rolled-back'; spec section 6.4).
- [`testing.FakeSession.script`](../api/testing.FakeSession.script.md): With `fail`, `problem` picks the spec's section 6.4 row: 'sync-failed' is the internal-failure row (a state write rolls back with reason 'internal-error'; a 'collection.load' resolves, then its commit drops the item), 'asset-failed' the asset rows (a declarative write commits without it, an imperative load rejects HoloAssetError): every asset that write fetches fails once, assets already loaded…

The set is open: handle a code you don't know (`'other'`).
