# Error Handling Review Lens

Review the provided code for **error handling gaps and failure mode issues**.

## What to Look For

### Swallowed Errors
- Empty catch blocks (catch and do nothing)
- Catch-and-log without re-raising or handling
- Silently returning null/None/default on failure
- `except Exception` or `catch (Exception e)` that's too broad

### Missing Handling
- Unchecked return values from I/O, network, system calls
- No try/catch around operations that can throw
- Missing null checks before dereferencing
- Resource cleanup not in finally/defer/with blocks

### Inconsistent Patterns
- Mix of exceptions and error codes in same codebase
- Some paths log errors, others don't
- Error messages with different formats or detail levels

### Poor Error Information
- Generic messages ("Something went wrong")
- Missing context (which operation, what input)
- Stack traces exposed to end users

## Output Format

For each finding:
```
[ERROR] <severity:HIGH|MED|LOW> <file:line>
Type: <swallowed|missing|inconsistent|poor-info>
Issue: <what's wrong with error handling>
Suggest: <add try/catch, check return value, add context, etc.>
```

## Guidelines

- HIGH = silent data corruption, crashes, security implications
- MED = poor debuggability, inconsistent user experience
- LOW = could be more defensive
- Consider: what happens when the happy path fails?
- Check for cleanup/resource leaks on error paths
- Empty catch with comment explaining why is acceptable (rare)
