Skip to content

Commit cfc2591

Browse files
jarugupjclaude
andcommitted
fall back to /health on non-2xx to distinguish API down from /status broken
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 42bdba0 commit cfc2591

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cmd/status.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ func runStatus(cmd *cobra.Command, args []string) error {
5050
defer resp.Body.Close()
5151

5252
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
53-
pterm.Error.Println("Kernel API is down. Check https://status.kernel.sh for updates.")
53+
msg := "Kernel API is down. Check https://status.kernel.sh for updates."
54+
if h, herr := client.Get(util.GetBaseURL() + "/health"); herr == nil {
55+
h.Body.Close()
56+
if h.StatusCode >= 200 && h.StatusCode < 300 {
57+
msg = "Kernel API is responding but /status is unavailable. Check https://status.kernel.sh for updates."
58+
}
59+
}
60+
pterm.Error.Println(msg)
5461
return nil
5562
}
5663

0 commit comments

Comments
 (0)