Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define separate error types for activation service errors #986

Conversation

sameh-farouk
Copy link
Member

@sameh-farouk sameh-farouk commented Jul 9, 2024

Description

EnsureAccount method now returns a custom error type ActivationServiceError for activation service-related errors.
This allows for easily identifying the source of the error by checking the type of error returned.

for example:

info, err := s.EnsureAccount(identity, activationURL, termsAndConditionsLink, terminsAndConditionsHash)
if err != nil {
    switch errType := err.(type) {
    case ActivationServiceError:
        // Handle Activation Service error
        fmt.Println("Activation service error:", errType.Err)
    default:
        // Handle other error types
        fmt.Println("Substrate error:", err)
    }
}

Related Issues:

Checklist:

@sameh-farouk sameh-farouk merged commit 5a9ad37 into development Jul 10, 2024
3 checks passed
@sameh-farouk sameh-farouk deleted the development-go-client-distinguish-activation-service-errors-iss-985 branch July 10, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants