looker-open-source / looker-sdk-ruby

Looker SDK for Ruby
MIT License
14 stars 12 forks source link

Bug in streaming client #88

Open alexf101 opened 1 week ago

alexf101 commented 1 week ago

Hey, we ran into a bug when using the streaming client where it gets a 401 back from the Looker server and ignores the error.

I suspect the following code in the build_response method of the streaming client: https://github.com/looker-open-source/looker-sdk-ruby/blob/92cb759090d44f9fa8524a552508d8e6cbcdcb6e/lib/looker-sdk/client.rb#L393-L415.

It looks to me like it's avoid calling the block handler if the response code isn't 200, but it's not actually raising an exception. The unless progress thing is also always true if the HTTP connection opened, even if the response status is not 200, so we found in practice that our code ignored this error.

I'm guessing this should be refactored to use the error handling code here? https://github.com/looker-open-source/looker-sdk-ruby/blob/92cb759090d44f9fa8524a552508d8e6cbcdcb6e/lib/looker-sdk/error.rb#L33-L58

drstrangelooker commented 6 days ago

Can you share more, like a sample call that has this problem?

Thanks