REST clients return bare status errors — use status.Code

SkillCloud & infra

Use when a REST-backed resource (SCIM group/user, Grafana) fails to soft-delete on 404, or when cxsdk.Code returns Unknown for a status.Error from rest/client.go.

Use REST clients return bare status errors — use status.Code in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add REST clients return bare status errors — use status.Code and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the REST clients return bare status errors skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

REST clients return bare status errors — use status.CodeStart free

What this skill tells your AI

The instructions your AI receives, as published by coralogix/terraform-provider-coralogix in .claude/skills/rest-client-not-found-detection/SKILL.md and read by Ahel’s review.

Trigger: A read/delete path for SCIM groups, SCIM users, or Grafana uses cxsdk.Code(err) == codes.NotFound, but the branch never runs for a real 404.

Fix: Keep rest/client.go returning a bare status error, and check with status.Code:

// internal/clientset/rest/client.go
return "", status.Error(codes.NotFound, "Not found")

// call site
if status.Code(err) == codes.NotFound { ... RemoveResource }

Why: cxsdk.Code only unwraps *cxsdk.SdkAPIError (SDK gRPC clients). The hand-rolled REST client returns a plain status.Error. Matching pair is status.Code. Wrapping REST errors in SdkAPIError only to keep cxsdk.Code is unnecessary.

Trap: Do not mix them. After a wrap, status.Code returns Unknown. After no wrap, cxsdk.Code returns Unknown. OpenAPI facade clients are separate — use cxsdkOpenapi.IsNotFound.

Signals

GitHub stars
22
Forks
14
Last commit
Oct 2026
Advanced
Item type
skill
Key
rest-client-not-found-detection
Source
github.com/coralogix/terraform-provider-coralogix