Seed Bible extension API (v1.18.0) / seed-bible/extensions / SandboxError
Class: SandboxError
Why a call to Seed Bible failed. Every sb.* promise rejects with one of these when the app refuses or can't complete the call.
permission_denied: the call needs a permission that isn't granted.invalid_request: bad arguments, a main-only call from a view, or a call that needs a user interaction made at another time.messagesays which.not_found: the pane, note, save or narration named doesn't exist.limit_exceeded: too many tools or panes, storage full, a dialog already open, or a response too large.unavailable: not possible right now (signed out, a service failed, a device couldn't be used, no reader open).internal: a bug in Seed Bible itself.
Example
try {
await sb.notes.create({ bookId: "JHN", chapter: 3, text: "…" });
} catch (err) {
if (err instanceof SandboxError && err.code === "unavailable") {
void sb.app.toast("Sign in to save notes.");
}
}Extends
Error
Constructors
Constructor
new SandboxError(code: SandboxErrorCode, message: string): SandboxError;Parameters
| Parameter | Type |
|---|---|
code | SandboxErrorCode |
message | string |
Returns
SandboxError
Overrides
Error.constructor
Properties
code
readonly code: SandboxErrorCode;Which way the call failed; see SandboxError.