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

go-client: changed statements' Err type to string, tagged by error #5059

Merged
merged 1 commit into from
Dec 9, 2015
Merged
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
12 changes: 6 additions & 6 deletions client/v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,18 @@ func NewQuery(command, database, precision string) Query {
// Response represents a list of statement results.
type Response struct {
Results []Result
Err error
Err string `json:"error,omitempty"`
}

// Error returns the first error from any statement.
// Returns nil if no errors occurred on any statements.
func (r *Response) Error() error {
if r.Err != nil {
return r.Err
if r.Err != "" {
return fmt.Errorf(r.Err)
}
for _, result := range r.Results {
if result.Err != nil {
return result.Err
if result.Err != "" {
return fmt.Errorf(result.Err)
}
}
return nil
Expand All @@ -439,7 +439,7 @@ func (r *Response) Error() error {
// Result represents a resultset returned from a single statement.
type Result struct {
Series []models.Row
Err error
Err string `json:"error,omitempty"`
}

func (uc *udpclient) Query(q Query) (*Response, error) {
Expand Down