Restyle fixes (#14)

* Applying style fixes

* Implement more notes

* Improvements

* Applying v2 design

* flyout restyle

* fix spec rev

* Status icons

* Restyle top line and footer

* Shorter err msg
This commit is contained in:
Andrey Pokhilko
2022-10-02 11:50:28 +01:00
committed by GitHub
parent 1b6dc4159a
commit 1e3a706698
10 changed files with 250 additions and 150 deletions

View File

@@ -21,6 +21,17 @@ import (
"time"
)
type CmdError struct {
Command []string
OrigError error
StdErr []byte
}
func (e CmdError) Error() string {
//return fmt.Sprintf("failed to run command %s:\nError: %s\nSTDERR:%s", e.Command, e.OrigError, e.StdErr)
return string(e.StdErr)
}
type DataLayer struct {
KubeContext string
Helm string
@@ -46,9 +57,18 @@ func (d *DataLayer) runCommand(cmd ...string) (string, error) {
log.Warnf("STDERR:\n%s", serr)
}
if eerr, ok := err.(*exec.ExitError); ok {
return "", fmt.Errorf("failed to run command %s:\nError: %s\nSTDERR:%s", cmd, eerr, serr)
return "", CmdError{
Command: cmd,
StdErr: serr,
OrigError: eerr,
}
}
return "", CmdError{
Command: cmd,
StdErr: serr,
OrigError: err,
}
return "", err
}
sout := stdout.Bytes()