mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user