18 lines
306 B
Go
18 lines
306 B
Go
package workspaceruntime
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func commandError(action, output string, err error) error {
|
|
if err == nil {
|
|
return nil
|
|
}
|
|
output = strings.TrimSpace(output)
|
|
if output == "" {
|
|
return fmt.Errorf("%s: %w", action, err)
|
|
}
|
|
return fmt.Errorf("%s: %s: %w", action, output, err)
|
|
}
|