Switch important_paths to using result::CargoResult
authorCarl Lerche <me@carllerche.com>
Fri, 9 May 2014 17:29:49 +0000 (10:29 -0700)
committerCarl Lerche <me@carllerche.com>
Fri, 9 May 2014 17:29:49 +0000 (10:29 -0700)
src/cargo/util/important_paths.rs

index 81fce8bd4c6ce6b4e99b302afb4e15cfc74f4bd6..ec53e41f4b9bd51a1f9e44c67583f5de2e536627 100644 (file)
@@ -1,4 +1,4 @@
-use core::errors::{CargoResult,CargoError,MissingManifest};
+use util::{other_error,CargoResult,CargoError};
 
 pub fn find_project(pwd: Path, file: ~str) -> CargoResult<Path> {
     let mut current = pwd.clone();
@@ -11,5 +11,10 @@ pub fn find_project(pwd: Path, file: ~str) -> CargoResult<Path> {
         if !current.pop() { break; }
     }
 
-    Err(CargoError::internal(MissingManifest(pwd, file)))
+    Err(manifest_missing_err(&pwd, file.as_slice()))
+}
+
+fn manifest_missing_err(pwd: &Path, file: &str) -> CargoError {
+    other_error("manifest not found")
+        .with_detail(format!("pwd={}; file={}", pwd.display(), file))
 }