Skip to content

Commit e3e543a

Browse files
Handle non-200 status codes from Claude API
1 parent 06457ae commit e3e543a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/claude/claude.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ func GenerateCommitMessage(config *types.Config, changes string, apiKey string)
6767
}
6868
defer resp.Body.Close()
6969

70+
if resp.StatusCode != http.StatusOK {
71+
return "", fmt.Errorf("claude AI response %d", resp.StatusCode)
72+
}
73+
7074
var claudeResponse ClaudeResponse
7175
if err := json.NewDecoder(resp.Body).Decode(&claudeResponse); err != nil {
7276
return "", err

0 commit comments

Comments
 (0)