File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ func runStatus() error {
3535
3636 health , err := c .CheckHealth ()
3737 if err != nil {
38- printer .PrintError (fmt .Sprintf ("Daemon is not running (%s)" , c .BaseURL ))
39- printer .PrintError ("Database is not healthy" )
38+ printer .PrintFailure (fmt .Sprintf ("Daemon is not running (%s)" , c .BaseURL ))
39+ printer .PrintFailure ("Database is not healthy" )
4040 return nil
4141 }
4242
@@ -49,7 +49,7 @@ func runStatus() error {
4949 if health .Database == "ok" {
5050 printer .PrintSuccess ("Database is healthy" )
5151 } else {
52- printer .PrintError (fmt .Sprintf ("Database is not healthy: %s" , health .Database ))
52+ printer .PrintFailure (fmt .Sprintf ("Database is not healthy: %s" , health .Database ))
5353 }
5454
5555 return nil
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ func PrintError(message string) {
4646 fmt .Fprintf (os .Stderr , "Error: %s\n " , message )
4747}
4848
49+ // PrintFailure prints a negative-status message with a cross-mark prefix to stdout.
50+ // Use for reporting expected negative conditions (e.g. "daemon is not running")
51+ // rather than PrintError which implies an unexpected error.
52+ func PrintFailure (message string ) {
53+ _ , _ = fmt .Fprintf (os .Stdout , "✗ %s\n " , message )
54+ }
55+
4956// PrintWarning prints a warning message
5057func PrintWarning (message string ) {
5158 _ , _ = fmt .Fprintf (os .Stdout , "Warning: %s\n " , message )
You can’t perform that action at this time.
0 commit comments