Skip to content

Commit

Permalink
feat: add error context if starting strace fails
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma-s1n committed Apr 17, 2024
1 parent 4a79932 commit eb0bca2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/strace/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::io::BufReader;
use std::path::PathBuf;
use std::process::{Child, Command, Stdio};

use anyhow::Context as _;

use crate::strace::parser::LogParser;

pub struct Strace {
Expand Down Expand Up @@ -49,7 +51,8 @@ impl Strace {
.args(command)
.env("LANG", "C") // avoids locale side effects
.stdin(Stdio::null())
.spawn()?;
.spawn()
.context("Failed to start strace")?;

Ok(Self {
process: child,
Expand Down

0 comments on commit eb0bca2

Please sign in to comment.