#[non_exhaustive]pub enum SyncError {
Tree(TreeError),
Validation {
errors: Vec<PackValidationError>,
},
Exec(ExecError),
Halted(Box<HaltedContext>),
WorkspaceBusy {
workspace: PathBuf,
lock_path: PathBuf,
},
Lockfile {
path: PathBuf,
source: LockfileError,
},
InvalidOnlyGlob {
pattern: String,
source: Error,
},
EventLogMigration(ManifestError),
SchedulerCancelled,
}Expand description
Error taxonomy surfaced by run.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Tree(TreeError)
The pack-tree walker failed (loader error, git error, cycle, …).
Validation
One or more plan-phase validators flagged the graph.
Fields
errors: Vec<PackValidationError>Aggregated errors from manifest-level + graph-level validators.
Exec(ExecError)
An action executor returned an error.
Retained for backward compatibility; new call sites should prefer
SyncError::Halted which carries full pack + action context.
Kept non-deprecated because From<ExecError> still materialises
the variant for non-sync-loop callers (e.g. ad-hoc helpers).
Halted(Box<HaltedContext>)
Action execution halted; full context (pack, action index, error,
optional recovery hint) lives in HaltedContext. This is the
variant the sync driver emits — SyncError::Exec is only
surfaced by ancillary code paths.
WorkspaceBusy
Another grex process (or thread) already holds the workspace-level
lock. The running sync refused to start to avoid racing two concurrent
walkers into the same workspace. If the lock file at lock_path is
stale (no other grex is actually running), remove it by hand.
Fields
Lockfile
Reading or parsing the resolved-state lockfile failed. Surfaced as
its own variant (rather than folded into Validation) because a
corrupt / unreadable lockfile is an I/O or schema fault, not a
dependency-satisfaction fault. Resolution is operator-level
(restore a backup, delete the file, re-sync), not author-level.
Fields
source: LockfileErrorUnderlying lockfile error.
InvalidOnlyGlob
One of the --only <GLOB> patterns failed to compile. Surfaced
as its own variant so the CLI can map it to a dedicated usage
error exit code instead of the generic sync-failure bucket.
Fields
EventLogMigration(ManifestError)
Migrating the v1.x event log (grex.jsonl) to the v2 canonical
path (.grex/events.jsonl) failed. Operator-level resolution
(check filesystem permissions, free disk space, then retry).
SchedulerCancelled
Cooperative cancellation fired (Ctrl-C / SIGTERM) during a parallel sync. v1.2.0 Stage 1.g wires the rayon walker to surface this distinct-from-failure variant so the CLI can exit with a dedicated cancellation code instead of a generic sync error. Dormant until Stage 1.g — the existing CLI does not yet emit it.
Trait Implementations§
Source§impl Error for SyncError
impl Error for SyncError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()