MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / exit_code

Method exit_code

atomic-core/src/crdt/apply/error.rs:609–637  ·  view source on GitHub ↗

Returns an appropriate exit code for this error. Exit codes follow Unix conventions: - 0: Success (not applicable for errors) - 1: General error - 2: Misuse (user error) - 65: Data format error - 70: Internal software error - 74: I/O error

(&self)

Source from the content-addressed store, hash-verified

607 /// - 70: Internal software error
608 /// - 74: I/O error
609 pub fn exit_code(&self) -> i32 {
610 match self {
611 // User errors (could be fixed by user action)
612 ApplyError::TrunkNotFound { .. }
613 | ApplyError::BranchNotFound { .. }
614 | ApplyError::LeafNotFound { .. }
615 | ApplyError::PathNotFound { .. }
616 | ApplyError::TrunkAlreadyExists { .. }
617 | ApplyError::BranchAlreadyExists { .. }
618 | ApplyError::LeafAlreadyExists { .. }
619 | ApplyError::PathAlreadyExists { .. }
620 | ApplyError::InvalidTrunkState { .. }
621 | ApplyError::InvalidBranchState { .. }
622 | ApplyError::InvalidLeafState { .. } => 2,
623
624 // Data format errors
625 ApplyError::ContentOutOfBounds { .. }
626 | ApplyError::InvalidContent { .. }
627 | ApplyError::InsertionPositionNotFound { .. }
628 | ApplyError::CircularReference { .. }
629 | ApplyError::OrderingViolation { .. } => 65,
630
631 // I/O errors
632 ApplyError::Storage { .. } => 74,
633
634 // Internal errors
635 ApplyError::InternalError { .. } => 70,
636 }
637 }
638}
639
640impl fmt::Display for ApplyError {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected