Skip to content

Commit ad44904

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 ad44904

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/status.go

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

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

0 commit comments

Comments
 (0)