# error_handler > 3. **Recovery Processing**: - For transient errors: implement retry with exponential backoff - For permanent errors: skip retry, log permanently - For critical errors: immediate escalation to human operator - Author: madnan-github - Repository: madnan-github/per-ai-emp001 - Version: 20260201131933 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/madnan-github/per-ai-emp001 - Web: https://mule.run/skillshub/@@madnan-github/per-ai-emp001~error_handler:20260201131933 --- # Error Handler Skill ## Purpose and Use Cases The Error Handler skill provides centralized error handling, logging, and recovery mechanisms across all other skills. It captures exceptions, implements retry logic, escalates critical issues, and ensures system resilience by maintaining operational stability even when individual components fail. ## Input Parameters and Expected Formats - `error_object`: Dictionary containing error details - `type`: Error type (string) - `message`: Error message (string) - `traceback`: Stack trace information (string) - `timestamp`: When error occurred (ISO format) - `skill_name`: Originating skill name (string) - `operation`: Operation that failed (string) - `retry_count`: Current retry attempt (integer) - `context`: Contextual information (dictionary) - `retry_config`: Configuration for retry mechanism - `max_attempts`: Maximum retry attempts (integer) - `delay_seconds`: Initial delay between retries (integer) - `backoff_factor`: Multiplier for delay on each retry (float) - `jitter`: Random factor to prevent thundering herd (boolean) ## Processing Logic and Decision Trees 1. **Error Reception**: - Receive error details from calling skill - Validate error object structure - Extract error classification information 2. **Error Classification**: - Determine error category (transient, permanent, critical) - Apply pattern matching for error type identification - Assess severity level based on impact 3. **Recovery Processing**: - For transient errors: implement retry with exponential backoff - For permanent errors: skip retry, log permanently - For critical errors: immediate escalation to human operator 4. **Logging and Documentation**: - Sanitize error message to remove sensitive information - Record in central error log with full context - Update error metrics and statistics 5. **Notification and Escalation**: - Send appropriate notifications based on severity - Create escalation tickets for critical issues - Update dashboard with error status ## Output Formats and File Structures - Creates error logs in /Logs/error_log_[date].log - Maintains error statistics in /Data/error_statistics.db - Generates error reports in /Reports/errors_[date].md - Updates Dashboard.md with error metrics and system health - Creates escalation tickets in /Pending_Approval/ for critical errors ## Error Handling Procedures - Capture errors immediately with full context - Sanitize error messages to prevent information leakage - Implement circuit breaker pattern to prevent cascading failures - Apply exponential backoff for retry mechanisms - Escalate critical errors to human operators - Log all error handling activities for audit purposes ## Security Considerations - Sanitize error messages to prevent sensitive data exposure - Encrypt sensitive error context in logs - Implement rate limiting on error notifications - Mask credentials and PII in error logs - Secure escalation channels to prevent unauthorized access ## Integration Points with Other System Components - All other skills call Error Handler when exceptions occur - Integrates with Notification Aggregator for alerting - Connects with Dashboard Updater for system health metrics - Updates Audit Logger with error handling activities - Creates action files in /Pending_Approval for critical escalations