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

Method suggestion

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

Returns a user-friendly suggestion for resolving this error.

(&self)

Source from the content-addressed store, hash-verified

521
522 /// Returns a user-friendly suggestion for resolving this error.
523 pub fn suggestion(&self) -> &'static str {
524 match self {
525 ApplyError::TrunkNotFound { .. } => {
526 "The referenced file does not exist. Please verify the file was created \
527 and the change dependencies are applied in the correct order."
528 }
529 ApplyError::BranchNotFound { .. } => {
530 "The referenced line does not exist. Please verify the line was created \
531 and the change dependencies are applied in the correct order."
532 }
533 ApplyError::LeafNotFound { .. } => {
534 "The referenced token does not exist. Please verify the token was created \
535 and the change dependencies are applied in the correct order."
536 }
537 ApplyError::PathNotFound { .. } => {
538 "The specified file path does not exist in the repository. Please verify \
539 the path is correct and the file has been added."
540 }
541 ApplyError::TrunkAlreadyExists { .. } => {
542 "A file with this ID already exists. This may indicate duplicate change \
543 application or a CRDT ID collision (extremely rare)."
544 }
545 ApplyError::BranchAlreadyExists { .. } => {
546 "A line with this ID already exists. This may indicate duplicate change \
547 application or a CRDT ID collision (extremely rare)."
548 }
549 ApplyError::LeafAlreadyExists { .. } => {
550 "A token with this ID already exists. This may indicate duplicate change \
551 application or a CRDT ID collision (extremely rare)."
552 }
553 ApplyError::PathAlreadyExists { .. } => {
554 "A file already exists at this path. Use a different path or delete/move \
555 the existing file first."
556 }
557 ApplyError::InvalidTrunkState { .. } => {
558 "The file is not in the correct state for this operation. For example, \
559 you cannot delete an already-deleted file."
560 }
561 ApplyError::InvalidBranchState { .. } => {
562 "The line is not in the correct state for this operation. For example, \
563 you cannot restore a line that isn't deleted."
564 }
565 ApplyError::InvalidLeafState { .. } => {
566 "The token is not in the correct state for this operation. For example, \
567 you cannot modify a deleted token."
568 }
569 ApplyError::InsertionPositionNotFound { .. } => {
570 "Could not find a valid position for insertion. This may indicate missing \
571 dependencies or corrupted ordering data."
572 }
573 ApplyError::CircularReference { .. } => {
574 "A circular reference was detected in the CRDT ordering. This indicates \
575 data corruption and should be reported as a bug."
576 }
577 ApplyError::OrderingViolation { .. } => {
578 "The operation would violate CRDT ordering constraints. This may indicate \
579 a bug in change generation."
580 }

Callers 1

Calls

no outgoing calls

Tested by 1