Skip to main content

ErrorCode

Enum ErrorCode 

Source
#[non_exhaustive]
pub enum ErrorCode {
Show 85 variants InvalidPath, ProfileNotFound, IoError, ParseError, UnsupportedSchema, MissingField, InvalidValue, InvalidId, IdMismatch, FieldNotAllowed, PassthroughNotAllowed, InvalidRef, UnknownClient, UnknownOs, Locked, GitError, AlreadyExists, NotFound, UnexpectedShape, NotSupportedOnOs, ScopeNotSupported, UnsupportedTransport, UnsupportedField, MsixDualWrite, Collision, TimeoutUnitConflict, ClientMcpReplacedByExtension, FileChangedDuringApply, EntryChanged, SelfCheckFailed, FileLocked, DeliveryUnavailable, NoAdapter, NeedsSecretExtraction, ConfirmationRequired, UnfinishedApply, LeakDetected, MissingSecret, SecretLocked, ProviderUnavailable, ProviderTooOld, SecretError, LauncherNotFound, NoSecretFreeDelivery, SecretInSharedFile, InlineEnvFallback, RemoteUnreachable, RemoteIncomplete, SyncArtifactIgnored, MergeConflict, RemoteRejected, RemoteAuthFailed, ToolNotFound, ClientSkipsEntry, UnknownTemplate, CannotSuppressInProject, UnsetNotExpressible, TrustRequired, DuplicateViaCompat, DuplicateAcrossLayers, PrivateInTrackedFile, ProjectKeySpelling, PersonalPathInSharedFile, ReadOnlyClient, NeedsManualSecret, ReadOnlyFormat, ClientEnableRequired, RestartRequired, SourceUnreachable, SourceTrustRequired, SourceBlocked, UpdateFailed, ReadOnlyTarget, ScanBlocked, CheckoutOutOfDate, FolderOnOtherMachine, CatalogsOff, CatalogHostWaiting, CatalogUnreachable, ScannerUnavailable, ScannerDownloadFailed, ScannerVerificationFailed, Canceled, ExternalScanRequired, HostWaiting,
}
Expand description

Stable error code, serialized as snake_case (the same string as ErrorCode::as_str).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidPath

A path argument, override or path field is unusable (for example relative, or personal where a placeholder is required).

§

ProfileNotFound

The user profile directory could not be determined.

§

IoError

A file could not be read or written.

§

ParseError

A file is not valid UTF-8, or not valid in its format (TOML, JSON, JSONC).

§

UnsupportedSchema

A store file declares a schema version this build does not read.

§

MissingField

A required field is absent.

§

InvalidValue

A field has the wrong type or a value outside its allowed set.

§

InvalidId

An identifier breaks the rules of SPEC 5.1.

§

IdMismatch

An id disagrees with the file or directory name that holds it.

§

FieldNotAllowed

A field is present where the rest of the definition forbids it (for example url on a stdio server).

§

PassthroughNotAllowed

A client.<id> key is not in that client’s passthrough allowlist.

§

InvalidRef

A template or secret reference does not parse (SPEC 11.2).

§

UnknownClient

A client id is not in the adapter table. Warning: kept as written.

§

UnknownOs

An OS name is not windows, linux or macos. Warning: kept as written.

§

Locked

Another process holds state/surjection.lock and the wait timed out.

§

GitError

The store repository could not be read or written.

§

AlreadyExists

An entity with this id already exists.

§

NotFound

No entity with this id exists.

§

UnexpectedShape

A native client file parses, but a value on the path being read or edited has another kind (for example mcpServers is an array).

§

NotSupportedOnOs

A client has no target on this operating system (Claude Desktop on Linux).

§

ScopeNotSupported

A client has no target in the requested scope (Claude Desktop at project scope).

§

UnsupportedTransport

A client cannot run a server over this transport (HTTP on Claude Desktop). The target is blocked; nothing is dropped silently.

§

UnsupportedField

A client has no native field for a set server field (cwd on Claude Desktop). The target is blocked; nothing is dropped silently.

§

MsixDualWrite

Warning: an MSIX install keeps its own copy of a client file, so both copies are written (Claude Desktop on Windows).

§

Collision

Warning: a client treats another entry name as the same server (Pi counts names that differ only in - and _ as one), so writing the entry would clash with it.

§

TimeoutUnitConflict

Clients with different units for the same timeout key read one file (omp timeout in milliseconds and Pi timeout in seconds, both in $PI_CODING_AGENT_DIR/mcp.json; gate V2 OMP-10), and the entry sets that key. The entry is blocked; no unit is guessed.

§

ClientMcpReplacedByExtension

Warning: an installed extension takes over the client’s MCP support (Pi with pi-mcp-adapter), so the client’s own MCP config may not be what loads.

§

FileChangedDuringApply

A client file kept changing between planning and writing (SPEC 8.4 step 1, after three re-plans). The file is left as it is.

§

EntryChanged

The entry a resolution was chosen for changed (in the file or in the store) since the resolver showed it; nothing was done (SPEC 13.4).

§

SelfCheckFailed

The edited file did not read back as planned: an owned entry differs from the desired one, or something outside the owned entries changed (SPEC 8.4 step 3). The file is left as it is.

§

FileLocked

Another process kept a client file open for longer than the retry window (Windows sharing violation, SPEC 8.4 step 4).

§

DeliveryUnavailable

The delivery mode a server asks for (delivery.mode) cannot bring a reference to this client and field, or a value cannot be written without changing its meaning (a literal ${ the client would expand). The entry is blocked; nothing is written in plain text.

§

NoAdapter

Warning: a known client has no adapter in this build yet, so nothing is written for it.

§

NeedsSecretExtraction

A native entry holds literal values that may be secrets; importing it needs secret extraction (SPEC 11.7) instead of copying the values.

§

ConfirmationRequired

The operation changes state that later operations changed too and needs an explicit confirmation (rolling back an older apply, SPEC 8.7).

§

UnfinishedApply

Warning: an apply run did not finish; its journal lists what each file got (SPEC 8.4 step 6). Nothing is replayed.

§

LeakDetected

A staged store file or commit message holds what looks like a secret, or a value resolved during this process (SPEC 11.8). Nothing is written or committed.

§

MissingSecret

A secret reference has no value: env var unset, keyring entry or 1Password item absent, alias not defined (SPEC 11.3 missing).

§

SecretLocked

1Password (or the keyring) needs sign-in or approval (SPEC 11.3 locked).

§

ProviderUnavailable

A secret provider is not on this machine (“1Password CLI not found”, no Secret Service; SPEC 11.3 provider_unavailable).

§

ProviderTooOld

A secret provider is older than a feature needs (SPEC 11.11).

§

SecretError

A secret provider failed for another reason, or the value cannot be read from here (SPEC 11.3 error, unverifiable).

§

LauncherNotFound

launch delivery needs the absolute path of the surject binary and it could not be resolved (SPEC 11.4, 11.5). The entry is blocked; nothing falls back to inline.

§

NoSecretFreeDelivery

A provider reference has no delivery mode that keeps its value out of the client’s config file for this client and field (SPEC 11.4 rule 2). Fixes: export to the environment, or allow inline for the server.

§

SecretInSharedFile

inline delivery would write a secret value into a shared file (SPEC 11.4 rule 3). Fixes: env or launch, or the project-local layer.

§

InlineEnvFallback

Warning: a ${env:NAME} reference is written as the value of Surjection’s own environment, because the client cannot expand it there and launch cannot carry it (SPEC 11.4 rule 1).

§

RemoteUnreachable

A remote cannot be reached (drive unplugged, share unmounted, host offline, SPEC 9.6). Retried later; never blocks local work.

§

RemoteIncomplete

A machine subfolder of a folder remote lists objects that have not arrived yet (a sync tool still copying, SPEC 9.6). Retried later.

§

SyncArtifactIgnored

Info: a file under a folder remote matches a sync tool’s conflict or temp pattern; it is never read and never deleted (SPEC 9.6).

§

MergeConflict

A pull found fields both sides changed differently (SPEC 9.9). HEAD is unchanged; state/merge/MERGE_STATE.json lists the conflicts.

§

RemoteRejected

A git remote refused the push (not a fast-forward even after the pull and one retry, or a protected ref; SPEC 9.8).

§

RemoteAuthFailed

A git remote refused the credentials, or none were available.

§

ToolNotFound

An external program Surjection needs for this (git, gh) is not installed or not on PATH.

§

ClientSkipsEntry

Warning: a foreign client entry that the client itself skips (gate V1 CC-5); importing it starts a server the client never ran.

§

UnknownTemplate

A project entry’s from names no store server (SPEC 6.2); that entry is blocked, the rest of the project applies.

§

CannotSuppressInProject

Warning: a project suppresses a system server for a client that has no way to hide a user server in a project (SPEC 6.3).

§

UnsetNotExpressible

Warning: a project entry uses unset, but the client merges project entries over user ones field by field (Codex), so the inherited key still reaches it. The entry is written anyway.

§

TrustRequired

A project’s manifests are not trusted on this machine, or changed since they were trusted (SPEC 17); nothing in that project is written until surject project trust <P>.

§

DuplicateViaCompat

Warning: a client loads the same server twice, once through another tool’s file it also reads (SPEC 6.4 client-compat:).

§

DuplicateAcrossLayers

Warning: a client runs same-named entries of its own files as separate servers (Grok Build’s user and project files, gate V2 CUR-5), so two servers of that name run (SPEC 6.4).

§

PrivateInTrackedFile

A private (local-layer) entry would go to a project file that the project’s git repository tracks (SPEC 6.5); the entry is blocked.

§

ProjectKeySpelling

Warning: Claude Code’s projects map already holds this folder under another spelling of its path (case or separators), so the client may read the other key (gate V1 FB-1).

§

PersonalPathInSharedFile

Warning: a shared project file gets ${project} as this machine’s absolute folder; teammates see a path that is not theirs.

§

ReadOnlyClient

Warning: a client Surjection only reads (vscode-legacy, SPEC 7.3) is named where something would be written for it; nothing is written.

§

NeedsManualSecret

A native value is one the client prompts the user for (VS Code ${input:...}): it has no store form and must be set up as a secret by hand before the entry can be imported.

§

ReadOnlyFormat

The native file can be read but not edited without risking its meaning (SPEC 7.2): a JSON5 file that is not also JSONC, or a YAML file whose target entry cannot be located unambiguously (anchors, aliases, flow style). The target is blocked; the file is untouched.

§

ClientEnableRequired

Info: a client lists each new server of its project file as disabled until the user enables it once in the client (Grok Build > Customize > MCPs, gate V2 CUR-2). The toggle is the client’s own state, so Surjection cannot read it; the entry is written anyway.

§

RestartRequired

Info: a client reads its file only at launch (Claude Desktop, gate V2 AP-6), and the file was written; the change loads after a full quit and restart of the client.

§

SourceUnreachable

A skill’s source (git repository or folder) cannot be reached or no longer holds the skill (SPEC 12.4). The store copy is left intact.

§

SourceTrustRequired

An install or update from a source the user has not trusted, without the user’s answer to the trust prompt (#24). Nothing was written; ask the user (app dialog, interactive prompt, --trust-source).

§

SourceBlocked

A block in sources.toml matches the source (#24); nothing is fetched or written until the block is removed.

§

UpdateFailed

The desktop app’s update check or install failed, or updates are turned off or not part of this build (SPEC 16.4).

§

ReadOnlyTarget

A client file or folder this account cannot write (access denied, a read-only attribute, another owner, a read-only share or mount), found by the probe while planning or refused by the OS at write time (SPEC 8.2, #4). The target is blocked and left as it is; the rest of the run goes on. CoreError::read_only gives the kind.

§

ScanBlocked

The built-in scan’s verdict on a skill (or MCP server source) is dangerous (SPEC 17); nothing is installed or updated unless the user explicitly chooses to install anyway (--allow-dangerous).

§

CheckoutOutOfDate

A server added from a Git repository runs from this machine’s checkout (<SURJECTION_HOME>/servers/<id>), which is missing or not at the commit the server file names (#5). The entry is blocked until surject server checkout <id> (or the app’s Restore) brings it to that commit; the old code never runs with the new command.

§

FolderOnOtherMachine

A server added from a local folder on another machine (#5): the folder is that machine’s, so the entry is blocked here.

§

CatalogsOff

Online catalogs are off on this machine (#26): nothing was contacted. The user turns them on (Install > Browse, or surject catalog online on).

§

CatalogHostWaiting

Online catalogs are on, but the catalog’s host is not approved yet (M60, #40: a host added since the user turned catalogs on, such as skills.sh after an upgrade from before 0.9): nothing was contacted. The user allows it (Settings > Catalogs, Install > Browse, or surject catalog online on).

§

CatalogUnreachable

A catalog could not be reached or answered with an error (timeout, HTTP status, rate limit, a body too large or not JSON).

§

ScannerUnavailable

The optional external scanner (SkillSpector, #30) cannot do what was asked: it is turned off on this machine, or the step does not apply (no uv to prepare with, already set up on PATH); nothing ran.

§

ScannerDownloadFailed

The external scanner could not be downloaded (network, HTTP status, a redirect to a host Surjection does not download from, too large).

§

ScannerVerificationFailed

The external scanner’s download is not the pinned build (size or SHA-256); it was deleted and nothing was installed.

§

Canceled

The user canceled the operation (a scanner install); nothing was changed.

§

ExternalScanRequired

The external scanner is on, installed and has a token, but the install or update carries no external report (its scan has not run): run the scan, then try again. Nothing was changed.

§

HostWaiting

“Check this address” (#47) would contact a host the user has not allowed (never asked, or answered no): nothing was contacted. The user answers the host prompt (the app, a terminal) or passes --allow-host.

Implementations§

Source§

impl ErrorCode

Source

pub const fn as_str(self) -> &'static str

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorCode

Source§

impl Debug for ErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ErrorCode

Source§

impl Hash for ErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ErrorCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more