Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
cli: Improve error when radicle-node isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Mar 22, 2024
1 parent 25c7162 commit 33be2a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions radicle-cli/src/commands/node/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::fs::{File, OpenOptions};
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom};
use std::{fs, io, path::Path, process, thread, time};

use anyhow::anyhow;
use localtime::LocalTime;

use radicle::node;
Expand Down Expand Up @@ -61,7 +62,8 @@ pub fn start(
.stdin(process::Stdio::null())
.stdout(process::Stdio::from(log.try_clone()?))
.stderr(process::Stdio::from(log))
.spawn()?;
.spawn()
.map_err(|e| anyhow!("failed to start node process {cmd:?}: {e}"))?;
let pid = term::format::parens(term::format::dim(child.id()));

if verbose {
Expand Down Expand Up @@ -98,7 +100,8 @@ pub fn start(
let mut child = process::Command::new(cmd)
.args(options)
.envs(envs)
.spawn()?;
.spawn()
.map_err(|e| anyhow!("failed to start node process {cmd:?}: {e}"))?;

child.wait()?;
}
Expand Down

0 comments on commit 33be2a6

Please sign in to comment.