TaskValidator.Validators.ErrorHandlingValidator (TaskValidator v0.9.2)
View SourceValidates error handling sections and requirements for tasks.
This validator ensures that tasks have appropriate error handling documentation according to their type (main task vs subtask) and implements the comprehensive error handling guidelines defined for the project.
Validation Rules
Main Tasks: Must have comprehensive error handling sections
- Error Handling with Core Principles, Implementation, Examples, GenServer Specifics
- Can use
{{error-handling}}
reference instead of explicit sections - All required subsections must be present if not using references
Subtasks: Have simplified error handling requirements
- Error Handling with Task-Specific Approach and Error Reporting
- Can use
{{error-handling-subtask}}
or{{subtask-error-handling}}
references - More focused on task-specific error patterns
Reference Support: Validates proper reference usage
- Checks for valid error handling references in content
- Allows references to substitute for explicit sections
- Maintains compatibility with reference system
Completed Tasks: Additional error handling implementation validation
- Must have Error Handling Implementation section
- Documents actual error handling patterns used
Error Types
:missing_error_handling
- No error handling section or reference found:incomplete_error_handling
- Missing required error handling subsections:invalid_error_handling_format
- Error handling content doesn't match expected format:missing_error_implementation
- Completed task missing implementation details
Examples
# Valid main task error handling (explicit)
**Error Handling**
**Core Principles**
- Pass raw errors
- Use {:ok, result} | {:error, reason}
- Let it crash
**Error Implementation**
- No wrapping
- Minimal rescue
- function/1 & /! versions
**Error Examples**
- Raw error passthrough
- Simple rescue case
- Supervisor handling
**GenServer Specifics**
- Handle_call/3 error pattern
- Terminate/2 proper usage
- Process linking considerations
# Valid using reference
{{error-handling}}
# Valid subtask error handling
**Error Handling**
**Task-Specific Approach**
- Error pattern for this task
**Error Reporting**
- Monitoring approach
Summary
Functions
Returns medium priority (55) since error handling validation is important but should run after basic structure validation.
Validates error handling sections according to task type and status.
Functions
Returns medium priority (55) since error handling validation is important but should run after basic structure validation.
Validates error handling sections according to task type and status.
Context Requirements
:references
- Available references for validation (optional)
Returns
- Success if error handling requirements are met
- Failure with specific error details for missing or invalid sections