Skip to content

Error Handling Enhancement #103

Description

@skovtunenko

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions