hashicorp / hcat

Hashicorp Configuration and Templating library (hcat, pronounced hashicat)
Mozilla Public License 2.0
95 stars 12 forks source link

added check for 500 to determine when to reset index for blocking query #105

Closed wilkermichael closed 2 years ago

wilkermichael commented 2 years ago

Used method similar to CTS to extract the status code from error string

In the future, consul api library should be upgraded as there is a StatusError type that would allow for us not to rely on parsing a string.

Resolves #103

wilkermichael commented 2 years ago

@eikenb I tried upgrading the library but it was causing a bunch of issues, if we go with this solution we can get the fix in faster.

This solution isn't completely out of left field, we do something similar in CTS when checking the errors returned from the Consul API Library, and I believe some other projects do similar things as well.

We can always upgrade the Consul API library in the future to be able to use the StatusError type. I'd like to do the same things in CTS eventually