Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ func runStatus(cmd *cobra.Command, args []string) error {
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode >= 300 {
pterm.Error.Println("Could not reach Kernel API. Check https://status.kernel.sh for updates.")
if h, err := client.Get(util.GetBaseURL() + "/health"); err == nil {
h.Body.Close()
if h.StatusCode >= 200 && h.StatusCode < 300 {
pterm.Error.Println("Kernel API is responding but /status is unavailable. Check https://status.kernel.sh for updates.")
return nil
}
}
pterm.Error.Println("Kernel API is down. Check https://status.kernel.sh for updates.")
return nil
}

Expand Down
Loading