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

QueryIterator should not panic on error #79

Open
alespour opened this issue Apr 9, 2024 · 0 comments
Open

QueryIterator should not panic on error #79

alespour opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@alespour
Copy link
Contributor

alespour commented Apr 9, 2024

Specifications

  • Package Version: 0.6.0
  • InfluxDB Version: Cloud

Code sample to reproduce problem

When result contains unsupported data type, the following calls may cause panic.

ok := iterator.Next()
// or
pv := iterator.AsPoints()


Expected behavior

Next() and AsPoints() should not panic, but somehow return error.

Next methods could be changed according to these iterator guidelines and AsPoints similarly. ie

func (i *QueryIterator) Next() (map[string]interface{}, error) // how about adding a new type (or alias) for the value?
func (i *QueryIterator) AsPoints() (*PointValues, error)

This renders Value method useless, btw.

So perhaps adding a new iterator type designed according to the guidelines, and deprecating the existing one would be a better solution.

Actual behavior

panic may occur

Additional info

No response

@alespour alespour added the bug Something isn't working label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant