Error Handling Enhancement
Current code doesn't expose error types. Add custom error types for better error handling:
// Create new file: errors.go
package graterm
type TerminationTimeoutError struct {
Timeout time.Duration
}
func (e *TerminationTimeoutError) Error() string {
return fmt.Sprintf("termination timed out after %v", e.Timeout)
}
// Update terminator.go Wait() method:
func (t *Terminator) Wait(appCtx context.Context, timeout time.Duration) error {
// ... existing code ...
case <-time.After(timeout):
return &TerminationTimeoutError{Timeout: timeout}
// ... rest of code ...
}
Or something like that
Error Handling Enhancement
Current code doesn't expose error types. Add custom error types for better error handling:
Or something like that