Loading...
Loading...
Scans code for error handling and resilience issues — swallowed exceptions, missing try/catch on external calls, unhandled promise rejections, missing transactions, validation gaps, retry/timeout omissions, and logging blind spots. Generates severity-scored findings with copy-pasteable fix prompts. Trigger phrases: "error handling check", "exception audit", "resilience check", "try/catch review", "error handling audit".
npx skill4agent add nishilbhave/codeprobe-claude codeprobe-error-handling../codeprobe/shared-preamble.md../codeprobe/references/fullcodeprobe-securitySECHandler.phpcodeprobe-security| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| Empty catch blocks | Search for | Major |
| Catch-log-only without handling | Find catch blocks that only contain a log/print statement but don't rethrow, return an error, or take any recovery action. The exception is swallowed after logging. | Minor |
| Overly broad exception catching | | Major |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| External API calls without try/catch | Search for HTTP client calls (Guzzle, axios, fetch, requests, HttpClient), payment SDK calls (Stripe, PayPal), AWS SDK calls, and other external service integrations. Flag when these calls are NOT wrapped in try/catch or .catch(). | Major |
| Unhandled promise rejections | Search for async functions or promise chains without | Major |
| File I/O without error handling | | Minor |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| Generic error messages | API responses returning only "Something went wrong", "Internal server error", or similar without error codes or actionable detail for the client. | Minor |
| Leaking internal errors to API consumers | Exception messages, stack traces, SQL errors, or file paths exposed in API JSON/HTML responses. Check error handling middleware configuration. | Major |
| Missing structured error responses | API endpoints returning errors without consistent structure (no error code field, no message field, inconsistent formats across endpoints). | Minor |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| External service calls without timeout | HTTP client calls without timeout configuration. Guzzle without | Major |
| No retry for transient failures | External API calls that could fail transiently (HTTP 429, 503, network errors) with no retry mechanism. | Minor |
| No circuit breaker for cascading failures | Service-to-service calls in microservice architectures with no circuit breaker or fallback pattern. | Suggestion |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| Missing input validation before processing | Functions that accept external input (request params, file contents, API payloads) and use them directly without validation. | Major |
| Implicit null assumptions | Accessing properties or calling methods on values that could be null/undefined without null checks. Chaining | Minor |
| Type coercion bugs | PHP | Minor |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| Multi-step DB ops without transactions | Multiple | Critical |
| Transaction without proper rollback | Transaction blocks that catch exceptions but don't rollback, or that have code after the transaction that assumes success without checking. | Major |
| ID Prefix | What to Detect | How to Detect | Severity |
|---|---|---|---|
| No logging on critical failure paths | Catch blocks in critical business logic (payment, auth, order processing) that don't include any logging. Failures happen silently. | Major |
| Missing correlation/request IDs | Log statements in request-handling code without correlation ID, request ID, or trace ID. Makes debugging distributed issues impossible. | Minor |
ERR-ERR-001ERR-002PaymentService@charge\Stripe\Exception\ApiErrorException$orderId$amountPaymentFailedExceptionDB::transaction()OrderService@createapp/Services/NotificationService.php:88ExternalApiClient.php:30->timeout(10)->retry(3, 100)