# Error Recovery

When operations fail, use these recovery patterns:

### Workflow: Handle Indexing Failures

```
1. create_store() fails or job_status shows 'failed'
   → Check error message
   → Common issues:
     - Git auth required (private repo)
     - Invalid URL/path
     - Disk space
     - Network timeout

2. Recovery actions:
   - Auth issue: Provide credentials or use HTTPS
   - Invalid path: Verify URL/path exists
   - Disk space: delete_store() unused stores
   - Network: Retry with smaller repo or use --shallow

3. Verify recovery:
   list_stores() → Check store appeared
   search(test_query, stores=[new_store]) → Verify searchable
```

**Example:**

```
create_store('https://github.com/private/repo', 'my-repo')
→ job_id: 'job_xyz'

check_job_status('job_xyz')
→ Status: failed
→ Error: "Authentication required for private repository"

# Recovery: Use authenticated URL or SSH
create_store('git@github.com:private/repo.git', 'my-repo')
→ job_id: 'job_xyz2'

check_job_status('job_xyz2')
→ Status: completed
→ Success!
```
