# Error Handling Reference

> Check RLS policies in dashboard or via pg_policies table. Ensure user has required role.

- Skill: `tools-only/error-handling-reference-9` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/error-handling-reference-9`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/error-handling-reference-9/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-29
- Page: https://skillmd.com/skills/tools-only/error-handling-reference-9

---

# Error Handling Reference

### Invalid JWT
**Error Message:**
```
Invalid JWT: expired or malformed
```

**Cause:** JWT token has expired or is incorrectly formatted

**Solution:**
```bash
Check token expiry with supabase.auth.getSession() and call refreshSession() if needed
```

---

### RLS Policy Violation
**Error Message:**
```
new row violates row-level security policy for table
```

**Cause:** Row Level Security (RLS) policy is blocking the operation

**Solution:**
Check RLS policies in dashboard or via pg_policies table. Ensure user has required role.

---

### Connection Pool Exhausted
**Error Message:**
```
too many clients already
```

**Cause:** Connection pool limit reached due to too many concurrent connections

**Solution:**
```typescript
Use connection pooling mode in Supabase dashboard. Switch to Session mode or pgBouncer.
```
