From 368b99ecfac0b94725606591dfc096ead538629f Mon Sep 17 00:00:00 2001 From: Shane C Date: Thu, 4 Jul 2024 17:16:13 -0400 Subject: [PATCH] properly handle error --- linux/run.go | 4 ++-- main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/run.go b/linux/run.go index 2bfa888..ec90af2 100644 --- a/linux/run.go +++ b/linux/run.go @@ -54,7 +54,7 @@ func (cmd *LinuxCommand) Run() error { if exitErr.ExitCode() == 127 { return ErrCommandNotFound } else { - return fmt.Errorf("%w: %w", ErrRunningCmd, err) + return fmt.Errorf("%s: %w", ErrRunningCmd.Error(), err) } } } @@ -66,7 +66,7 @@ func (cmd *LinuxCommand) Run() error { if exitErr.ExitCode() == 127 { return ErrCommandNotFound } else { - return fmt.Errorf("%w: %w", ErrRunningCmd, err) + return fmt.Errorf("%s: %w", ErrRunningCmd.Error(), err) } } } diff --git a/main.go b/main.go index e5b9d97..31c1b00 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -package main +package shell import ( "bytes"