not-ready | A member that needs a document was called before the first loadDocument. | Thrown or rejected. | Call loadDocument first. |
destroyed | A member was called after destroy. Calling destroy again does nothing. Pending asynchronous calls also reject with it. | Thrown or rejected. | Stop using the editor. Mount a new one if you need it. |
stale-document | The expected generation isn’t the loaded one; a text range or heading entry comes from an older snapshot; or the document changed while asynchronous work, such as a copy, print, image import, cut or host slash command, was running. | Thrown or rejected; events.error for work the person started. | Don’t retry with the same generation or range. Read the state again and act again if it still applies. |
composition | Text composition (IME) is in progress and the call would read or change the document, or change editability or input preferences. | Thrown or rejected. | Retry after commandStateChanged reports composing: false. |
operation-pending | An image import is still running. | Thrown or rejected; events.error for a copy or cut. | Retry after commandStateChanged reports pending: false. |
read-only | A member that changes the document was called while editable is false, or the person pressed an editing key. | Thrown or rejected; events.error for a cut or shortcut. | Call setEditable(true) first, or disable the control. |
invalid-argument | An argument has the wrong type, is out of range, or names something unknown: an option, event, label, shortcut, command, mode, scope or field. It also covers a load whose generation isn’t greater than the loaded one, a link destination Inkkit wouldn’t open, and a host slash command that returns something other than text. | Thrown or rejected; events.error for a slash command. | Fix the call. It is a host defect and fails again with the same arguments. |
invalid-range | A current text range can’t be used: an offset is outside the text or splits a surrogate pair, it covers part of an image label, footnote label or callout title, or a replacement crosses an image, a line break, a hidden comment or a block boundary. | Thrown. | Don’t retry the same range. Use a range inside one text block, or source mode for syntax. |
preservation | An edit would save Markdown that doesn’t reopen as shown, so it was refused; a load got Markdown it can’t keep; or snapshot, a copy or a mode switch can’t write the current content. | Thrown or rejected by the call; events.error for an edit the person made. | Don’t retry the same edit or load. After a failed snapshot, don’t save, and keep the document open. See preservation. |
image-unavailable | Image bytes can’t be obtained: print found an authored image with no adapter or with unreadable bytes; a paste or drop couldn’t import an image and inserted a placeholder; or a cut was refused because a selected image can’t be copied. | Rejected by printableSnapshot; events.error. | Supply the bytes through the adapter, then retry. |
diagram-unavailable | A Mermaid diagram can’t be previewed; print can’t rasterize a diagram that previewed; or a cut was refused because a selected diagram can’t be copied. | Rejected by printableSnapshot; events.error. | Nothing; the source is kept. If the page sets a Content Security Policy, allow blob: images, which diagram export needs. |
file-unavailable | A file or wiki link can’t be resolved, shown or opened, or a note suggestion request failed. | events.error. | Fix the adapter result. The file card’s Retry button asks again. See adapters. |
clipboard-unavailable | Images or diagrams were copied or cut with no events.clipboard handler, or the handler threw or rejected. A cut removes nothing. | events.error. | Add a clipboard handler, or let the person try again once the clipboard can be written. |
internal | An unexpected exception. It is never a designed outcome, except that an error thrown by a host slash command’s action also arrives as internal (#332). The original error is cause. | Thrown, rejected or events.error. | Report it, keep the document open, and take a fresh snapshot before trusting the editor’s state. |