Error Handling
Error Categories
The VoP Scheme defines specific error categories and codes that must be implemented by all participants:
1. Technical Errors (VOP_001)
- System unavailability
- Network issues
- Infrastructure problems
2. Security Errors (VOP_002)
- Certificate validation failures
- Authentication errors
- Authorization issues
3. Timeout Errors (VOP_003)
- Response time exceeded
- Service unavailable
- Network timeout
4. Validation Errors (VOP_004)
- Invalid input format
- Missing required fields
- Business rule violations
5. Business Errors (VOP_005)
- Account not found
- Account inactive
- Service restrictions
Standard Error Response
All error responses follow this standardized format:
{
"errorReference": "ERR-123e4567",
"timestamp": "2024-12-16T12:00:01Z",
"error": {
"code": "VOP_004",
"category": "VALIDATION_ERROR",
"message": "Invalid account details",
"details": {
"field": "iban",
"reason": "Account not found in directory"
}
},
"metadata": {
"respondingPSP": "BANKXX22",
"originalRequest": "REQ-123456"
}
}
Error Handling Requirements
1. Response Times
- All errors must be returned within 2 seconds
- Timeout errors must be triggered after 3 seconds
- Retry mechanism required for timeout scenarios
2. Error Logging
- All errors must be logged with:
- Timestamp
- Error category and code
- Request reference
- Participating PSPs
3. Error Recovery
interface VoPErrorHandler {
async handleError(error: VoPError): Promise<void> {
switch (error.category) {
case 'TECHNICAL':
await this.handleTechnicalError(error);
break;
case 'SECURITY':
await this.handleSecurityError(error);
break;
case 'TIMEOUT':
await this.retryWithExponentialBackoff(error);
break;
case 'VALIDATION':
await this.handleValidationError(error);
break;
case 'BUSINESS':
await this.handleBusinessError(error);
break;
}
}
private async retryWithExponentialBackoff(
error: VoPError,
maxRetries: number = 3
): Promise<void> {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
await this.wait(Math.pow(2, attempt) * 1000);
return await this.retryRequest(error.originalRequest);
} catch (retryError) {
if (attempt === maxRetries) throw retryError;
}
}
}
}
Error Monitoring
Required Metrics
- Error rate by category
- Average response time for errors
- Retry success rate
- Error distribution by PSP
Reporting Requirements
- Daily error summary
- Monthly error analysis
- Critical error alerts
- Performance impact analysis
Error Prevention
Best Practices
- Implement request validation
- Monitor certificate expiration
- Regular connection testing
- Maintain audit logs
Security Measures
- Certificate rotation plan
- Access control monitoring
- Network security checks
- Data validation rules
Testing Requirements
Error Scenarios
- Network disconnection
- Invalid certificates
- Timeout simulation
- Invalid input data
- Business rule violations
Response Validation
- Error format compliance
- Response time monitoring
- Retry mechanism testing
- Recovery procedures