Closed dylrich closed 5 months ago
Thanks for this -- I have not looked at the code this changes. Is this in response to a fetch of the /status endpoint?
Hi! Sorry, I missed your comment. Yes, this panic happens when parsing a /status response.
Thanks for your contribution.
If rqlite's store is not yet open, the store status JSON looks like:
There is no other information included. This causes gorqlite to panic because we assume there is always a "leader" field filled out, which is not the case before the store has opened.
I wasn't sure if this is exactly the way you'd like this fixed; technically we could change rqlite to have this information in the status endpoint as well, I think? I also wasn't too sure how to add a test for this, but would be willing to add one if you could point me to the proper place.
Thanks!