Skip to content

Commit

Permalink
Improve commit error
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 24, 2023
1 parent 17cd604 commit a6e2658
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ impl Commit {
}
};

// We apply the changes and create a new resource, but don't index it yet.
let mut resource_new = self
.apply_changes(resource_old.clone(), store, false)
.map_err(|e| format!("Error applying changes to Resource {}. {}", self.subject, e))?;
Expand All @@ -168,7 +169,7 @@ impl Commit {
let parent_str = parent.to_string();
if !self.subject.starts_with(&parent_str) {
return Err(format!(
"The parent '{}' is not part of the URL of the new subject '{}'.",
"You cannot create a new Resource with this subject, because the parent '{}' is not part of the URL of the new subject '{}'.",
parent_str, self.subject
)
.into());
Expand Down

0 comments on commit a6e2658

Please sign in to comment.