aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command')
-rw-r--r--crates/shirabe/src/command/exec_command.rs9
-rw-r--r--crates/shirabe/src/command/global_command.rs8
-rw-r--r--crates/shirabe/src/command/require_command.rs12
3 files changed, 19 insertions, 10 deletions
diff --git a/crates/shirabe/src/command/exec_command.rs b/crates/shirabe/src/command/exec_command.rs
index a67c234e..61391117 100644
--- a/crates/shirabe/src/command/exec_command.rs
+++ b/crates/shirabe/src/command/exec_command.rs
@@ -220,10 +220,11 @@ impl Command for ExecCommand {
&& getcwd().as_deref() != Some(iwd.as_str())
{
chdir(iwd).map_err(|e| {
- RuntimeException::new(format!(
- "Could not switch back to working directory \"{}\"",
- iwd
- ))
+ RuntimeException::with_code_and_previous(
+ format!("Could not switch back to working directory \"{}\"", iwd),
+ 0,
+ Some(std::sync::Arc::new(e)),
+ )
})?;
}
diff --git a/crates/shirabe/src/command/global_command.rs b/crates/shirabe/src/command/global_command.rs
index 78b6f3e6..df9798a3 100644
--- a/crates/shirabe/src/command/global_command.rs
+++ b/crates/shirabe/src/command/global_command.rs
@@ -90,8 +90,12 @@ impl GlobalCommand {
}
}
- chdir(&home).map_err(|_e| {
- RuntimeException::new(format!("Could not switch to home directory \"{}\"", home))
+ chdir(&home).map_err(|e| {
+ RuntimeException::with_code_and_previous(
+ format!("Could not switch to home directory \"{}\"", home),
+ 0,
+ Some(std::sync::Arc::new(e)),
+ )
})?;
if !quiet {
diff --git a/crates/shirabe/src/command/require_command.rs b/crates/shirabe/src/command/require_command.rs
index 84b4a6e4..88916175 100644
--- a/crates/shirabe/src/command/require_command.rs
+++ b/crates/shirabe/src/command/require_command.rs
@@ -977,10 +977,14 @@ impl Command for RequireCommand {
if self.newly_created.get() {
self.revert_composer_file();
- return Err(RuntimeException::new(format!(
- "No composer.json present in the current directory ({}), this may be the cause of the following exception.",
- self.file.borrow()
- ))
+ return Err(RuntimeException::with_code_and_previous(
+ format!(
+ "No composer.json present in the current directory ({}), this may be the cause of the following exception.",
+ self.file.borrow()
+ ),
+ 0,
+ Some(std::sync::Arc::new(e)),
+ )
.into());
}