From ec17b8aa7edcb9dd38c3142e82da360fcdcfdbb3 Mon Sep 17 00:00:00 2001 From: Mackiovello Date: Thu, 5 Jul 2018 19:02:50 +0200 Subject: [PATCH] Use custom error message for publish --- src/command/publish.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/command/publish.rs b/src/command/publish.rs index 3a39ed4..51cfdc7 100644 --- a/src/command/publish.rs +++ b/src/command/publish.rs @@ -10,7 +10,13 @@ pub fn publish(path: Option, log: &Logger) -> result::Result<(), Error> info!(&log, "Publishing the npm package..."); info!(&log, "npm info located in the npm debug log"); - npm::npm_publish(&crate_path)?; + match npm::npm_publish(&crate_path) { + Ok(r) => Ok(r), + Err(Error::Io { .. }) => Err(Error::DirNotFound { + message: "Unable to find the pkg directory".to_owned(), + }), + Err(e) => Err(e), + }?; info!(&log, "Published your package!"); PBAR.message("💥 published your package!");