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

Add CDC error #1163

Merged
merged 1 commit into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
errReadFailure = 0x1300
errFunctionFailure = 0x1400
errWriteFailure = 0x1500
errCDCWriteFailure = 0x1600
errSyntax = 0x2000
errUnauthorized = 0x2100
errInvalid = 0x2200
Expand Down Expand Up @@ -80,6 +81,10 @@ type RequestErrWriteFailure struct {
WriteType string
}

type RequestErrCDCWriteFailure struct {
errorFrame
}

type RequestErrReadTimeout struct {
errorFrame
Consistency Consistency
Expand Down
9 changes: 8 additions & 1 deletion frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,13 +657,20 @@ func (f *framer) parseErrorFrame() frame {
res.WriteType = f.readString()
return res
case errFunctionFailure:
res := RequestErrFunctionFailure{
res := &RequestErrFunctionFailure{
errorFrame: errD,
}
res.Keyspace = f.readString()
res.Function = f.readString()
res.ArgTypes = f.readStringList()
return res

case errCDCWriteFailure:
res := &RequestErrCDCWriteFailure{
errorFrame: errD,
}
return res

case errInvalid, errBootstrapping, errConfig, errCredentials, errOverloaded,
errProtocol, errServer, errSyntax, errTruncate, errUnauthorized:
// TODO(zariel): we should have some distinct types for these errors
Expand Down