1
0
Fork 0

More improved responses on HTTP 500

master
Philip O'Toole 3 years ago
parent 0e50ab255d
commit 875c09d9ca

@ -1,3 +1,7 @@
## 6.4.4 (unreleased)
### Implementation changes and bug fixes
- [PR #885](https://github.com/rqlite/rqlite/pull/885): Improved responses when `status/` returns HTTP 500.
## 6.4.3 (September 9th 2021)
### Implementation changes and bug fixes
- [PR #882](https://github.com/rqlite/rqlite/pull/882): Some minor improvements related to on-disk SQLite use.

@ -677,7 +677,8 @@ func (s *Service) handleNodes(w http.ResponseWriter, r *http.Request) {
// Get nodes in the cluster, and possibly filter out non-voters.
nodes, err := s.store.Nodes()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, fmt.Sprintf("store nodes: %s", err.Error()),
http.StatusInternalServerError)
return
}
@ -691,13 +692,15 @@ func (s *Service) handleNodes(w http.ResponseWriter, r *http.Request) {
lAddr, err := s.store.LeaderAddr()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, fmt.Sprintf("leader address: %s", err.Error()),
http.StatusInternalServerError)
return
}
nodesResp, err := s.checkNodes(filteredNodes, t)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, fmt.Sprintf("check nodes: %s", err.Error()),
http.StatusInternalServerError)
return
}
@ -798,7 +801,8 @@ func (s *Service) handleExecute(w http.ResponseWriter, r *http.Request) {
addr, err := s.store.LeaderAddr()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
http.Error(w, fmt.Sprintf("leader address: %s", err.Error()),
http.StatusInternalServerError)
return
}
if addr == "" {

Loading…
Cancel
Save