We had a bug where failed queries in the TUI would return an error or
an empty response but we were trying to access the response before
checking the error or the response size. This shifts logic around to
handle the error first and then check if the response is empty before
trying to access it.
How does this PR impact users? (This is the kind of thing that goes in release notes!)
What does this PR change?
We had a bug where failed queries in the TUI would return an error or an empty response but we were trying to access the response before checking the error or the response size. This shifts logic around to handle the error first and then check if the response is empty before trying to access it.
How does this PR impact users? (This is the kind of thing that goes in release notes!)
The TUI logic has been updated to accurately handle a query error case instead of panicking. See https://github.com/kubecost/kubectl-cost/issues/123 for an example.
Links to Issues or ZD tickets this PR addresses or fixes
How was this PR tested?
Locally after observing the panic as described in https://github.com/kubecost/kubectl-cost/issues/123. Now we get an error log instead of panicking. I am still working on fixing the underlying error.