Skip to content

Commit

Permalink
Add new type of error for schema disagreement
Browse files Browse the repository at this point in the history
  • Loading branch information
sylwiaszunejko committed Sep 5, 2024
1 parent 07c5a13 commit d31335c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ func (c *Conn) awaitSchemaAgreement(ctx context.Context) error {
}

// not exported
return fmt.Errorf("gocql: cluster schema versions not consistent: %+v", schemas)
return &schemaAgreementError{schemas: schemas}
}

var (
Expand All @@ -1905,3 +1905,11 @@ var (
ErrConnectionClosed = errors.New("gocql: connection closed waiting for response")
ErrNoStreams = errors.New("gocql: no streams available on connection")
)

type schemaAgreementError struct {
schemas []string
}

func (e *schemaAgreementError) Error() string {
return fmt.Sprintf("gocql: cluster schema versions not consistent: %+v", e.schemas)
}

0 comments on commit d31335c

Please sign in to comment.