NewValidationError creates a new validation error with context
(field, value, reason, suggestion string)
| 79 | |
| 80 | // NewValidationError creates a new validation error with context |
| 81 | func NewValidationError(field, value, reason, suggestion string) *WorkflowValidationError { |
| 82 | if errorHelpersLog.Enabled() { |
| 83 | errorHelpersLog.Printf("Creating validation error: field=%s, reason=%s", field, reason) |
| 84 | } |
| 85 | severity, category := classifyValidationSeverity(field, reason) |
| 86 | return &WorkflowValidationError{ |
| 87 | Field: field, |
| 88 | Value: value, |
| 89 | Reason: reason, |
| 90 | Suggestion: suggestion, |
| 91 | Severity: severity, |
| 92 | Category: category, |
| 93 | Timestamp: time.Now(), |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // OperationError represents an error that occurred during an operation |
| 98 | type OperationError struct { |